flashAS3.0 listening function parameters in the problem
Users questions: Listen function parameters mean anything XX.addeventlinstener (mouseevent.clik, fun) functionfun (event: Event Type) {} This event is a function of the parameters listen three questions I do not understand 1.event type is not and listener should listen for the same type of action (2) how to use this argument on behalf of what he was 3 and I can not write this event: mouseevent = Null can not be directly assigned to him 4. Why can I not write the type of success through Through compiler testing? Such as this is only a matter of fact I had to write a e
Experts answer: not quite understand the significance of this parameter, but with the more slowly know. To give you an example suppose you have a MovieClip, it's an instance named XX, we add a mouse click on his event detection Hearing is XX.addEventListener (MouseEvent.CLICK, clickfun), then only the mouse click on it clickfun this function will be executed. So under normal circumstances such as this function is written in clickfun Some vara: int = 0 This statement has nothing to do with the click event is less than that parameter. But there is a situation, if I have a lot on stage, MovieClip, I want to achieve the effect when you click any, on access to their reference, this way, the parameters will have to use The. We can write clickfun (e: MouseEvent) {vari: MovieClip = e.target;} In fact, e This parameter is used to obtain event information, and such as a keyboard when you add event listeners also participate by calling the The number of properties to achieve. Finally, add this parameter is to be added, even if you do not use, because you do not use the computer to be used to determine, and I hope I make you understand the answer, I welcome the exchange of blog ascust.blogbus.com