I notice in actionscript 3 that when a handler gets called, its able to access the senders properties. If I dispatch an event from my custom class. can all the listeners inherit all my public properties and methods?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your handler method is defined in the same class as the dispatching call then you can access the properties, as they are in the scope. This is not generally the case – if you add an event handler to a button’s “click” event for example – then you only have access to the properties of the button through a reference to that button (such as event.target). If you are more familiar with JS or AS2, then I understand why you are confused – in JS and AS2 the properties of an object is rarely in the scope of a method (you always need to use “this” to access instance properties for example).