Code tagged with events

Mixing in Actionscript V2 Components EventDispatcher class

Posted by Chad Humphries over 2 years ago
Import the package
import mx.events.EventDispatcher;

Declare the members to be mixed in later
function dispatchEvent() {};
function addEventListener() {};
function removeEventListener() {};

Withing your init() method, mix in the Event Dispatcher:
function init(){
	mx.events.EventDispatcher.initialize(this);
}

When you need to dispatch an event, simpy use dispatchEvent();
dispatchEvent({type:"change"});

Language ActionScript / Tagged with events