here are some other solutions for you:
Method 1 (quick but dirty): you can put function IN the event listener:
Method 2 (longer but a lil cleaner): create a variable in the button for you to accessPHP Code:Button1.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){ gotoAndStop("FrameLabel1");} , false, 0, true);
Button2.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){ gotoAndStop("FrameLabel2");} , false, 0, true);
PHP Code:// Add listeners to buttons
var Button1:YourSpecialButtonClass;
var Button2:YourSpecialButtonClass;
Button1.frameLabelTarget = 'FrameLabel1';
Button1.addEventListener(MouseEvent.CLICK, Navigate, false, 0, true);
Button2.frameLabelTarget = 'FrameLabel2';
Button2.addEventListener(MouseEvent.CLICK, Navigate, false, 0, true);
// Define the Navigate function
function Navigate(evt:MouseEvent):void{
gotoAndStop( (evt.currentTarget as YourSpecialButtonClass).frameLabelTarget );
}




Reply With Quote
