You want to make a button in flash using AS3? It’s easy!
1)MAKE SURE you’re movie clip has an instance name!

Also, please please please make sure you’re dealing with an actual “movie clip” and not a “button”.
The next step is to go to the Actionscript layer (you should have a layer label “actionscipt”, “as”, or something of that nature to hold all of your actionscript) and insert the following code:
instanceNameOfMovie_mc.addEventListener(MouseEvent.CLICK, nameOfFunction);
function nameOfFunction onClick(event:MouseEvent):void
{
trace(“You just made an event handler to handle mouse click events!”);
}
And you’re done! You’ve made a movieclip that acts like a button with event handlers!
Now, some of you may ask, “Why not just use a button?”. The reason, the gives you more flexibility, and this is your first step in learning how to control event handlers. There may be times when using a button may be more appropriate, but for now, this is the way to go.
You can see a list of what other “Events” can be paired with the “MouseEvent” listener here. Experiment!
