I’m trying to load an external swf when a button is clicked, but the darned thing is doing nothing! (No matter how often I click, or how fast… :sigh: haha)
Basically, there’s loads of animation going on on multiple layers, and then it reaches a point where the user has to decide what the next sequence of the animation is going to be. Clicking button1 loads pirateAttack.swf, while clicking button2 loads wormHole.swf, for example.
Except clicking is doing* no loading whatsoever*. ARG!
stop();
addEventListener(Event.ADDED_TO_STAGE, init);
function init(evt:Event):void {
btn_planet_gotoScene2.addEventListener(MouseEvent.CLICK, gotoScene2);
function gotoScene2(event:MouseEvent):void {
var request:URLRequest=new URLRequest("scene2.swf");
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);
}
}
I was getting an Error#1009 when my button and button function code wasn’t wrapped up in the addEventListener. It solved the error, but created a new problem!