📜 ⬆️ ⬇️

Check for AS3 class

At one point, I was tired of creating the same thing every time I created files with classes ... So I finally decided to automate this process.



So, first we make a blank. I wrote this:
')
 package {

	 ////////////////////////////////////////////////// /////////////////////////////////////////////////
	 // IMPORTS
	 ////////////////////////////////////////////////// /////////////////////////////////////////////////
	
	 import flash.display.Sprite;

	 ////////////////////////////////////////////////// /////////////////////////////////////////////////
	 // THE CLASS
	 ////////////////////////////////////////////////// /////////////////////////////////////////////////
	
	 public class ClassName extends Sprite {
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // PUBLIC STATIC CONSTANTS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // nothing here yet
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // PRIVATE STAITC CONSTANTS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // nothing here yet
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // PUBLIC CONSTANTS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // nothing here yet
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // PRIVATE CONSTANTS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // nothing here yet
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // PUBLIC VARS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // nothing here yet
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // PRIVATE VARS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // nothing here yet
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // GETTERS / SETTERS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // nothing here yet
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // PUBLIC METHODS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // constructor
		 public function ClassName () {
			
			 super ();
			
			 // nothing here yet
			
		 } // constructor
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		 // PRIVATE METHODS
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
		 // nothing here yet
		
		 ////////////////////////////////////////////////// /////////////////////////////////////////////////
		
	 } // class
	
	 ////////////////////////////////////////////////// /////////////////////////////////////////////////
	
 } // package


Save the file, call it say, Class.as and drag it into C: \ Documents and Settings \ All Users \ Templates.

After that, in the registry, in the HKEY_CLASSES_ROOT \ .as \ ShellNew section, create the string parameter FileName and assign it the value “Class.as” - the name we gave to the file.

For the lazy: copy-paste, save with the .reg extension, run and agree with the merge.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.as]
@="Flash.ActionScriptFile"

[HKEY_CLASSES_ROOT\.as\ShellNew]
"FileName"="Class.as"


And that's it! Now, anywhere we poke with the right button -> create -> Flash ActionScript File, and instead of an empty file, we have a blank with the prepared code.

PS: what can highlight as3-code?

Source: https://habr.com/ru/post/44209/


All Articles