Mar
25
2009

Event handler function – did you know that?

I have notisted that not many of you know about that. You can call an Event handler function normaly without the dispatchEvent. For example you have the button Click handler function:

private function buttonClick(e:MouseEvent):void {
          trace("button click");
}
 
/*If you write a function like this and you will call
 the buttonClick(); you will get an error that you 
havent provide the the Event.*/
 
private function buttonClick(e:MouseEvent = null):void {
          trace("button click");
}
 
/* if you try somethink like this, you can call
 the buttonClick() function whenever you like
 and you want get any errors!*/

Related Posts

About the Author: Kuba Gaj

Hi, my name is Kuba and I am the founder of massiveProCreation. I am interested in almost everything that is connected to technology (specially Adobe Flash). If you have any questions or suggestions please feel free to contact me :)

Leave a comment

Become an Author

We are looking for Authors, if you have a Flash (or related) knowledge and you want to share it with the community on our blog please contact us.

Partners