I have created a small file template for creating custom Event classes quickly and easily using IntelliJ IDEA. Simply go to Preferences > [IDE Settings] File Templates > Create a new template [click the + icon] > Name it i.e. ActionScript Event | Give it an extension i.e. as | enter the below script and your sorted. Now if you right click on your project and select New > ActionScript Event you can enter the couple of defined params and your done and dusted.
package ${PACKAGE_NAME}#if (${PACKAGE_NAME} != "") #end{
import flash.events.Event;
public class ${NAME} extends Event {
public static const ${CONST}:String = '${CONST}';
#if (${eventObject} != "")
public var ${eventObject}:${eventObjectClass};#end
public function ${NAME}( type:String,
#if (${eventObject} != "")
${eventObject}:${eventObjectClass},#end
bubbles:Boolean = false,
cancelable:Boolean = false ) {
super( type, bubbles, cancelable );
#if (${eventObject} != "") this.${eventObject} = ${eventObject};#end
}
override public function clone():Event{
return new ${NAME}( type,#if (${eventObject} != "") ${eventObject},#end bubbles, cancelable );
}
}
}
I have created a small file template for creating custom Event classes quickly and easily using IntelliJ IDEA. Simply go to Preferences > [IDE Settings] File Templates > Create a new template [click the + icon] > Name it i.e. ActionScript Event | Give it an extension i.e. as | enter the below script and your sorted. Now if you right click on your project and select New > ActionScript Event you can enter the couple of defined params and your done and dusted.
package ${PACKAGE_NAME}#if (${PACKAGE_NAME} != "") #end{ import flash.events.Event; public class ${NAME} extends Event { public static const ${CONST}:String = '${CONST}'; #if (${eventObject} != "") public var ${eventObject}:${eventObjectClass};#end public function ${NAME}( type:String, #if (${eventObject} != "") ${eventObject}:${eventObjectClass},#end bubbles:Boolean = false, cancelable:Boolean = false ) { super( type, bubbles, cancelable ); #if (${eventObject} != "") this.${eventObject} = ${eventObject};#end } override public function clone():Event{ return new ${NAME}( type,#if (${eventObject} != "") ${eventObject},#end bubbles, cancelable ); } } }