Creating a subclass from the Event class
package myEvents { import flash.events.Event; public class EnableChangeEvent extends Event { public function EnableChangeEvent(type:String, isEnabled:Boolean=false) { //Call the constructor of the class super(type); //Set the new property this.isEnabled = isEnabled; } //Define static constant. public static const ENABLE_CHANGED:String = "enableChanged"; //Define a public variable to hold the state of the enable property. public var isEnabled:Boolean; //Override the inherited cloe() method. override public function clone():Event { return new EnableChangeEvent(type, isEnabled); } } }

I’m Mariusz Tkaczyk.
Leave a comment