problem | |
adobe flex AS3.0 required steps in order to dispatch events good luck :) --- > page dennis | |
difficulty level | |
5/10 :) | |
compatibility | |
step1 the class where dispatch event, should extends the EventDispatcher object example: public class MDlogin extends EventDispatcher step2 create some (stupit) public strings… where will be the events (id) example:public var Event_LoginSuccess:String='Event_LoginSuccess'; step3 in order to dispatch an event call the dispatchEvent method (where is coming from EventDispatcher) example: dispatchEvent(new Event(Event_LoginSuccess)); step4 create your own custom Event object where will be dispatched. The Listeners, should get your Event object and not the Flex’s Event, in order the Listener to be able to get the additional public variables and functions of your custom events! - create a new Actionscript Class (file and so on) that extends the flash.events.Event class - add you public variables and functions where will be available for the listener (do not make it have, instead, give easily a reference of the object where dispatch the event) Conclusion An Event object is nothing more than a silly object that is useful because the runtimer can dispatch it! It is nothing more! It is a cabinet that can gives ready information to the listener (some public variables or much better only getters). If Flex’s world and in general OOP’s world, the Events are the only professional communication way between different and maybe unknown objects. |
Flexache, is the pain you feel in your brain when you coding on Adobe’s Flex Builder, Flash builder with Flex SDK and Actionscript in general. The pain is starting from the eyes, as you can’t believe what you see and is getting deep in your head as you can’t fix. In this blog I‘ll give you painkiller to get out of a lot strange troubles showing solutions and techniques in Flex.
Monday, 4 July 2011
required steps in order to dispatch your own events
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment