/* DeleteClickEvent - Custom Event example Copyright (C) 2010 Blogagic (http://blogagic.com/) Example discussed on Blogagic.com at: http://blogagic.com/133/adding-events-to-flex-custom-components Licensed under the Creative Commons BSD Licence http://creativecommons.org/licenses/BSD/ */ import flash.events.Event; public class DeleteClickEvent extends Event { // define a descriptive event name using a static String constant public static const DELETE_CLICK:String = "deleteClick"; // define your custom properties public var deleteObjectName:String; // add arguments to your constructor to provide values for your // custom properties (you can keep bubbles and cancelable arguments // as the last arguments). public function DeleteClickEvent(type:String, objName:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); // Store your custom properyy deleteObjectName=objName; } // override clone for event bubbling (if you don't, the cloned events // won't have your custom property available) override public function clone():Event { return new DeleteClickEvent(type, deleteObjectName, bubbles, cancelable); } // override toString for complete traces (i.e. including your custom properties) override public function toString():String { return formatToString("DeleteClickEvent", "type", "deleteObjectName", "bubbles", "cancelable", "eventPhase"); } }