Link to home
Start Free TrialLog in
Avatar of BenjaminWong
BenjaminWong

asked on

How to use button to load another swf file

Hi Expert, I am new to CS4 but I am learning.  I have created a simple button with intention to use it to load another swf file. I have used the following AS3 scrips but it did not work.  Plase help:

function setupEvents() {
      //associate events with event handlers
      myButton.addEventListener(MouseEvent.CLICK,clickButtonHandler);
      myButton.addEventListener(MouseEvent.CLICK,release);
}

setupEvents();
function clickButtonHandler(e:MouseEvent) {
trace("Clicked Button");
}


function release(e:MouseEvent):void {
      
trace("I am here");
var loader.load=new loader();
addChild(loader);
load("Question1exp.swf",1);



}
ASKER CERTIFIED SOLUTION
Avatar of mustang83
mustang83

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial