Tuesday, February 16, 2010

Action for Buttons

Moving Along the Timeline:


btnInstanceName.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerA);
function mouseDownHandlerA(event:MouseEvent):void {
gotoAndStop(1);
}


Loading and Unloading External Content

var myLoader1:Loader=new Loader ();
squBtn1.addEventListener(MouseEvent.CLICK, swf1content);
function swf1content(myevent1:MouseEvent):void {
var myURL1:URLRequest=new URLRequest("YourMovie.swf");
myLoader1.load(myURL1);
addChild(myLoader1);
}

cirBtn1.addEventListener(MouseEvent.CLICK, unloadSwf1content);
function unloadSwf1content(myevent5:MouseEvent):void {
removeChild(myLoader1);
}

No comments:

Post a Comment