Skip to content

Install Instructions

Torrunt edited this page Oct 2, 2011 · 10 revisions

(if you really need it)

  • Save developerconsole.as to the same folder as your project (if you put it some where else: change the package name accordingly)
  • Import the class at the top of your main class or on your first frame
  • Make an object called 'console' or whatever you want.
  • Make it equal a new developerconsole and pass in your main class or the stage if you don't use have one (e.g: console = new developerconsole(this);) and add it (addChild(console);).
  • Then just call console.open() to bring it up and console.close() to close it. (use console.opened to see if it's open all not).

Notes

  • Type help in the console to get some quick help.
  • Make sure 'Disable Keyboard Shortcuts' when testing your project in the Flash IDE as having them enabled can cause problems with the input text box.
  • Also if you're testing your project in the Flash IDE and you want the cursor to show in the input text box you have to click inside the swf at least once.

Example

package  {
	import flash.display.MovieClip;
	import flash.events.KeyboardEvent;
	import developerconsole;
	
	public class main extends MovieClip {
		
		public var console;
		
		public function main() {
			console = new developerconsole(this);
			addChild(console);
			
			stage.addEventListener(KeyboardEvent.KEY_UP,keyup);
		}
		
		private function keyup(e:KeyboardEvent){
			if (e.keyCode == 192) console.toggle();
		}
			
	}
}
Clone this wiki locally