I’ve got a series of swf files that load when you select a button (example 1.swf, 2.swf, 3.swf etc…). I load 1.swf, then use addChildAt() to unload 1.swf and load in 2.swf etc.
This works fine, but when I try to load 3.swf, 1.swf loads, and without prompting then 2.swf loads. I can never get past the second .swf file. Here’s my code for 1.swf:
var imageRequest:URLRequest = new URLRequest("2.swf");
var imageLoader:Loader = new Loader();
next_mc.addEventListener(MouseEvent.CLICK, nextButton);
function nextButton(event:MouseEvent):void {
imageLoader.load(imageRequest);
this.addChildAt(imageLoader, 1);
}
next_mc.buttonMode = true;
the code used in 2.swf:
var imageRequest:URLRequest = new URLRequest("3.swf");
var imageLoader:Loader = new Loader();
next_mc.addEventListener(MouseEvent.CLICK, nextButton);
function nextButton(event:MouseEvent):void {
imageLoader.load(imageRequest);
this.addChildAt(imageLoader, 1);
}
next_mc.buttonMode = true;
Can anybody see what I’m doing wrong to get the results I’m getting? I’d appreciate any help.