So I have a code, shown below:
import flash.events.MouseEvent;
instance160.stop();
function playMovie(event:MouseEvent):void
{
instance160.play();
}
button160.addEventListener(MouseEvent.CLICK, playMovie);
and I want to add multiple buttons, not just this one. I figured out by trial and error that I couldn’t just consecutively list the instances, I also found I couldn’t just replicate the code and change the instance names. I just need to know how to go about having multiple buttons/clips. Any help would be appreciated!
The “Event” class (which MouseEvent extends) has a property called “currentTarget”, which passes a reference to whatever object dispatched that event. So you can do something like this:
Is that more or less what you were looking for?