This content has been marked as final. Show 3 replies
Depends if the array is public or private...in the scope of the function . For example, in some applications, i will have a "container" array. This is declared before the actual constructor
public var containerArray:Array= new Array()
then you can access that array from any event handlers, etc. The danger of course is if you are playing with these variables a lot, or quickly, you loose flexibility. Another option, is to creat the variables in a class, and create instances of the class to be accessed later.
Well, not in that way.
The function automatically receives a parameter when you create a callback with that function by "addEventListener", such parameter is datatyped as the event type you defined in the callback, in your case "MouseEvent". If you want to pass more data when the function is called then you have to create your own event class because almost all events just inform when something has happened and send limited information. You can check the documentation about creating a custom event class, there is a lot of info about the topic.
thank you albert