4. Debugging an Adobe Flex application
For version 3 of the Monster Debugger we've built a special Flex component that integrates nicely with the existing Flex logging API. We advise Flex developers to use this component in their applications instead of the regular AS3 classes. Note that both can be used together in the same application without interfering with each other. The Flex component is part of the client SWC file and the code is pretty straightforward. The following example shows the Monster Debugger Flex component in a Main.mxml file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <s:application xmlns:fx= "http://ns.adobe.com/mxml/2009" xmlns:s= "library://ns.adobe.com/flex/spark" xmlns:mx= "library://ns.adobe.com/flex/mx" xmlns:debugger= "com.demonsters.debugger.*" creationcomplete= "onCreationComplete()" > <fx:script> <!--[CDATA[ import mx.logging.ILogger; import mx.logging.Log; private function onCreationComplete(): void { // Monster Debugger trace message monsterDebugger. trace ( this, "Hello World!" ); // Flex trace message var logger:ILogger = Log.getLogger( "Main.mxml" ); logger.error( "Hello World!" ); } ]]--> </fx:script> <debugger:monsterdebuggerflex id= "monsterDebugger" > </debugger:monsterdebuggerflex></s:application> |