$.console – Flash Debugging Console
August 25th, 2007The last couple of days have been pretty busy for me trying to make some progress with the Right-Click functionality in Flash 9, it is coming together pretty good and I hope to have a working Linux version very soon.
Besides that, I’m involved in some very cool Flash and AIR projects and I wanted to share some code with you that helps me in development on a daily basis.
$.console
So the concept behind the $.console is simple: make Actionscript 3 debugging easier and more portable. With that in mind I have developed a simple solution that can do the following:
- you can see trace() statements without external debugger right inside your application.
- you can control the application at will (launch functions and set and remove variables).
- you can hide it when you don’t need it (` key).
- it’s lightweight (sample application is only 8Kb)
- it uses AS3 Global Object
Sounds good? Let’s see some code!
Example Application:
Shows the maximum effort required to use $.console
-
package {
-
-
import flash.display.*;
-
import lt.uza.utils.*;
-
-
public class ConsoleTest extends Sprite
-
{
-
-
private var $:Global = Global.init();
-
-
public function ConsoleTest()
-
{
-
-
// Initialize the Console.
-
$.console = new Console();
-
-
// Show something.
-
$.trace("Hello World");
-
for (var i:int = 0; i<5; i++) {
-
$.trace("n"+i);
-
}
-
}
-
}
-
}
Screenshot:
Shows the console in action.

I hope you like it and find it useful as much as I do.
Download Source (v1.1)
Happy coding!


August 25th, 2007 at 5:16 am
I cannot seem to hide the console with the tilde ~ key (SHIFT + #) - however the backtick ` key works for this purpose.
This looks very useful
August 25th, 2007 at 5:33 am
You are right. I corrected the description in the post. Thanks
September 2nd, 2007 at 5:22 am
Hi,
I think this is a great Script. Nevertheless I found some bugs when I wanted to test it.
1) None of the Keyboard-Keys worked for me (german keyboard), except escape. I added keycode 220 here, which works good.
2) When I was adding the console to my Flex Application i the number of lines which where dispayed was limited. I traced 4 lines right after creating the console. when i then typed a command in the running application, it could'nt display more than 4 lines. The other lines were hidden. The only way to solve this problem was to set cacheAsBitmap = false; for the 2 textfields.
September 2nd, 2007 at 1:59 pm
Thanks for the great feedback Dave, I was wondering why it won't show up for some people. I will update the code ASAP
January 23rd, 2008 at 5:44 am
Nice man thanks!
having debug levels, will be sweet!
April 5th, 2008 at 5:06 pm
Dog On Girl Sex...
Find live, breaking sports news, live scores and all sports results here on Channel 9 Wide
...
April 5th, 2008 at 5:08 pm
Beastiality Clips...
Sports news, match reports and leading sport comment from The Times and Sunday Times
...
January 27th, 2009 at 9:50 pm
The ZIP file is no longer avaliable.
March 19th, 2009 at 7:44 am
Bummer, .zip is 404...
May 31st, 2009 at 12:46 am
Would love it if this were available for download again...
July 18th, 2009 at 1:00 pm
yes
the link is broken
October 6th, 2009 at 9:59 pm
Seems he changed the download system a bit... this should work:
http://www.uza.lt/downloads/classes/AS3/AS3_console_test.zip
December 29th, 2009 at 10:26 pm
What blog script do you use on your site ?