You can use an example provided by Subash Selvaraj, this is a good example.
My only point is: it seems to me that it's better to avoid creating a separate variable (for the event instance) every time you want to dispatch this event. You can add additional parameter to your class constructor instead.
So your new event class may look like following:
import flash.events.Event;
public class MyEvent extends Event
{
public var objEventData:Object;
public function MyEvent(type:String, event_data:Object=null, bubbles:Boolean=false, cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
objEventData = event_data;
}
public override function clone():Event
{
return new MyEvent(type, objEventData, bubbles, cancelable);
}
}
And in this case you can dispatch your event just like this:
dispatchEvent(new MyEvent(EVENT_TYPE, YOUR_DATA) );
After that you can access the passed data from your event handler, i.e. MyFunc:
private function MyFunc(event:MyEvent):void
{
var buff:Object = event.objEventData;
}
You can replace an Object class with any type you need.