Phonegap: Linking between scenes and optimizing memory usage

Update

After another research I’ve found this old post with a (seems not work) solution made by Charles M.

index.html?scene=SceneName?

I’ve modified the javascript and now the script seems to works fine.

function mainSceneLoad_externa (hypeDocument, element, event) {	
	if (window.donescene == true)
		return;
	
	window.donescene = true;
	
	var query = window.location.search.substring(1); 
	var vars = query.split("&"); 
 	for (var i=0;i<vars.length;i++) 
 	{ 
    	var pair = vars[i].split("="); 
    	if (pair[0] == "scene") { 

    		hypeDocument.showSceneNamed(pair[1], hypeDocument.kSceneTransitionInstant);
      		return;      		
      		
    	} 
  } 

Now I can open a specific scene in another Hype Project.
Here an example with two projects ( each with two scenes) and all related links ( from/to and vice versa).

download the project here / link_multitple_projects.zip (691.4 KB)

I’m wondering if someone ( expert) could improve this code in order to activate also a timeline in the scene? I’m not expert.

something like this:

index.html?scene=SceneName?timeline=TimelineName

it would be great!
Thanks in advance

1 Like