Posted by Sankar.G | Posted in AS3 | Posted on 2:43 PM
var i:Number;
for(i=0;i<=(buttonHolder.numChildren-1) ; i++)
{
buttonHolder.getChildAt(i).addEventListener(MouseEvent.CLICK, starter);
}
function starter(e:MouseEvent):void {
var ob=e.currentTarget;
trace(ob.name.substr(1));
}
select all buttons and create a movie clip and name it as buttonHolder and put this script it will work
for(i=0;i<=(buttonHolder.numChildren-1) ; i++)
{
buttonHolder.getChildAt(i).addEventListener(MouseEvent.CLICK, starter);
}
function starter(e:MouseEvent):void {
var ob=e.currentTarget;
trace(ob.name.substr(1));
}
select all buttons and create a movie clip and name it as buttonHolder and put this script it will work
Comments (0)
Post a Comment