Copy link to clipboard
Copied
hi, i have 3 project (A,B,C), I use the folowing code to navigate between them ( the project start with A, then i navigate to B its work, also if i want to return from B to A its work, But if i want to go from B to C it doesn't work , )
I'm into project A and i want to go in project B ===> No probleme its work good
// go to B
unité77.addEventListener(MouseEvent.CLICK,h_aller_exercices);
function h_aller_exercices(event:MouseEvent):void
{
var ex5_s:URLRequest=new URLRequest("division/B.swf");
var ex5_l:Loader=new Loader();
ex5_l.load(ex5_s);
addChild(ex5_l);
}
// ( I m in B) return from B to A ===> No probleme its work good
acc10.addEventListener(MouseEvent.CLICK,home10);
function home10(event:MouseEvent):void
{
var h10_s2:URLRequest=new URLRequest("../A.swf");
var h10_l2:Loader=new Loader();
h10_l2.load(h10_s2);
this.parent.removeChild(this);
addChild(h10_l2);
}
now I'm in project B and I want to go in project C
controle.addEventListener(MouseEvent.CLICK,cont1);
function cont1(event:MouseEvent):void
{
var h1_s2:URLRequest=new URLRequest("../evaluation/C.swf");
var h1_l2:Loader=new Loader();
h1_l2.load(h1_s2);
addChild(h1_l2);
}
Copy link to clipboard
Copied
What error are you getting when you try to load C from B? I would expect you are experiencing a file targeting problem since you are loading the file into a new loader in B.
Have you thought about having code in only one main swf for the loading and unloading? You can the main file assign the listeners to the loaded files after each file is loaded and have the event handler in the main file deal with all the loading/unloading. The loaded files would just generate a custom event when you interact to close them that the main file listens for.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now