IntelliJ IDEA Custom ActionScript Event Template

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 );
		}
}
}
This entry was posted in Actionscript, IntelliJ IDEA and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • FreeAgent sign-up


  • Recent Posts

  • Categories