Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created February 24, 2011 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrinaldi/842556 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/842556 to your computer and use it in GitHub Desktop.
Notify a new entry to an IEventDispatcher instance.
package tea.util
{
import flash.events.Event;
import flash.events.IEventDispatcher;
public function dispatch( p_dispatcher : IEventDispatcher, p_event : Object ) : void
{
if(p_event is String) {
p_dispatcher.dispatchEvent(new Event(p_event));
} else if(p_event.hasOwnProperty("clone")) {
p_dispatcher.dispatchEvent(p_event.clone());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment