The Adobe Flex 2: Training from the Source book has a chapter on custom
events that's very helpful.
http://www.amazon.com/Adobe-Flex-2-Training-Source/dp/032142316X/ref=pd_bbs_sr_1/002-4556397-3450415?ie=UTF8&s=books&qid=1180626175&sr=8-1

Here's a basic custom event class sample:

package mycomponents.events
{
   import flash.events.Event;
   //this can be a value object that you want to pass along with the event
   import mycomponents.valueObjects.MyObj;

   public class MyEvent extends Event
   {
       public var obj:MyObj;

       public function MyEvent(obj:MyObj,type:String) {
           super(type);
           this.obj = obj;
       }

       public override function clone():Event {
           return new MyEvent(obj,type);
       }
   }
}

Then when you dispatch it, type the event as your custom event type (you'll
need to import the custom event class) and pass in the value object and
event type/name.

Hope that helps!
Rachel

Reply via email to