import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.events.MouseEvent;
import flash.text.TextFormat;
for (var btn:int = 1; btn < 7; btn++) {
this["spot" + btn].buttonMode = true;
this["spot" + btn].addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
this["spot" + btn].addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
function onMouseOver(event:MouseEvent):void
{event.currentTarget.play();}
function onMouseOut(event:MouseEvent):void
{event.currentTarget.gotoAndStop(1);}
add multiple buttons addListerner AS3
/
0 comments:
Post a Comment