Hi,
I am very new to flex and trying to understand eventHandling.
I have created a custom event and would like to invoke it.
Below is the code of custom event class:
package com.xxx
{
import com.xxx.Me;
import flash.events.Event;
public class AddMeEvent extends Event
{
public static const ADDME:String = "add-me";
private var _me:Me;
public function AddMeEvent(type:String, me:Me){
super(type, true);
_me = me;
}
public override function clone():Event {
return new AddMeEvent(type, _me);
}
public function get me():Me {
return _me;
}
}
}
and for an obj of type Me in a class i add the above event as:
obj1.addEventListner(AddMeEvent.ADDME, addHandler);
addHandler method is as below:
private function addHandler(event:AddMeEvent):void{
dispatchEvent(new AddMeEvent(AddMeEvent.ADDME, event.target as Me));
}
but the addHandler code is not reached when i try to debug the above code. Pls help me if you could find what the error is.