Schemaphic Systems Blog

Sharing experiences in Flash, Flex and AIR

Dispatch Events in AS2.0

leave a comment »

function onComponentClickHandler( o:Object ):Void{
trace(“component clicked”);
//do something here
component.addEventListener(“click”, onComponentClickHandler);

//component class –
class com.Component extends MovieClip
public var addEventListener:Function; //declaring the function to access addEventListener of MovieClip

public function Component () {
this.onRelease = function() {
//creating the event object
var eventObj:Object = new Object();
eventObj.type = “click”; // event type = this; // event target


Written by Deepanjan Das

July 19, 2010 at 9:53 PM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: