In my last article I wrote that the big but of developing flash with the freeware compiler mxmlc from the Flex SDK is, that there is no tracing.
Well, there’s still not, but there is a fantastic tool called Alcon. It is written for the AIR, so it’s completely platform independent. That’s really, really cool. So how can you trace now? Well, you have to add the Alcon Library to your app, install Alcon and from then on you can trace. Too fast, okay, let’s go step by step.
1. Download Alcon
The first thing you are going to need is an installed AIR. You can download and install it for free:
Secondly you need to download Alcon and install it.
2. Add to compile path
You can start alcon now, but nothings gonna happen. You need to add the alcon.swc library to your compile path first. You’ll find it on OS X in the Alcon.app Package, filed under Resources/debug. In Windows Environments you have the alcon.swc in the folder of the alcon.
We could modify our bash script now or start adding parameters when calling, but the fairly most simple way is to copy the alcon.swc straight in the mxmlc/frameworks/libs path. From now on we auto-compile all we need. Cool thing.
3. Use it
I’m almost sure you tried it again. No, the standard trace still is not gonna work. But the last step, I promise. In every class you want to trace, simply add the import: import com.hexagonstar.util.debug.Debug; to the top. From then on you can use Debug.trace(“Hello World”);. Simply start the swf File and alcon at the same time and you’ll be able to trace all the outputs and many more.
Example
package { import flash.display.*; import flash.text.*; import com.hexagonstar.util.debug.Debug; [SWF(width="800", height="600", frameRate="40")] public class Main extends Sprite{ public function Main(){ stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; init(); } private function init():void{ //Output Debug.trace("Hello world!"); } } }




2 Responses to “ActionScript 3.0 – Trace MXMLC compiled movies”
Feb 4, 2010
I Will have to come back again when my class load lets up – nonetheless I am taking your RSS feed so I can read your site offline. Thanks.
1 Trackback(s)
Post a Comment