Posted By

visualadvance on 03/06/10


Tagged

event listener as3 dispatcher


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

davidino1978
gudeidea
tspitzr
adrianparr


AS3: Create an Event Dispatcher and Listener


 / Published in: ActionScript 3
 

This can be handy for a quick event dispatching without having to create a custom event class. This one in particular is "bubbling up" (true), and not cancelable (false).

  1. this.dispatchEvent (new Event("somethingHappened", true, false));
  2.  
  3.  
  4. this.addEventListener ("somethingHappened", yourFunction);

Report this snippet  

You need to login to post a comment.