Events are things like mouse clicks, key presses, etc. You can tell flash to listen for when an event occurs. When an event such as a mouse click is triggered, your "event handler" or your function will be called.

You can use addEventListener to tell flash what function or event handler to call when the event is triggered:

Code:
mybutton.addEventListener(MouseEvent.CLICK, MouseClickHandler);
Here we are telling flash to listen to the Mouse click event on mybutton.

When mybutton is clicked it will call our event handler function MouseClickHandler:

Code:
function MouseClickHandler(event:MouseEvent):void {
   trace("button is clicked");
}
Events are not limited to mouse clicks and keyboard presses. You can listen for an EnterFrame event, which is triggered every frame, or you could listen for a timer event, so you could call a function every second.


swak:

I was just about to make one . I'll post it later today.