Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See trace() of Flash when running in browser

What's an easy way to see the trace() output of Flash/Flex movies when running in any browser?

like image 924
Robin Rodricks Avatar asked May 14 '09 15:05

Robin Rodricks


3 Answers

Download and install the content debugger version of Flash Player.

Enable trace logging (official guide) by adding an mm.cfg file:

ErrorReportingEnable=1

    TraceOutputFileEnable=1

Where to save mm.cfg depends on the OS:

  • Mac OS X: /Library/Application Support/Macromedia
  • Windows: %HOMEDRIVE%\%HOMEPATH%
  • Linux: /home/user name

The log file, flashlog.txt, can be found at:

  • Windows 95/98/ME/2000/XP: C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs
  • Windows Vista: C:\Users\username\AppData\Roaming\Macromedia\Flash Player\Logs
  • Mac OS X: /Users/username/Library/Preferences/Macromedia/Flash Player/Logs/
  • Linux: /home/username/.macromedia/Flash_Player/Logs/

Optionally, you can install the Firefox add-on FBTracer which displays the trace output in a Firebug panel.

like image 128
Robin Rodricks Avatar answered Oct 05 '22 20:10

Robin Rodricks


i just use the console.log function (most recent browsers implement it);

import flash.external.ExternalInterface;

public static function log(msg:String, caller:Object = null):void{
        var str:String = "";
        if(caller){
            str = getQualifiedClassName(caller);
            str += ":: ";
        }
        str += msg;
        trace(str);
        if(ExternalInterface.available){
            ExternalInterface.call("console.log", str);
        }
    }
like image 24
NoelDrew Avatar answered Oct 05 '22 19:10

NoelDrew


Check out De Monster's MonsterDebugger. You can debug track objects, traces, and display chains in a lovely AIR application. Very fun to use. And it's open source!

http://demonsterdebugger.com/

You can also configure Flash and Flex to write to a log file. Check out how to do that here:

http://livedocs.adobe.com/flex/3/html/help.html?content=logging_04.html

I've been using Monster lately, but I used to have an alias that ran a unix "tail" on the flashlog file that would effectively give me a logging window for "in browser" tracing:

alias flashlog='tail -f /PATH/TO/flashlog.txt'

Or if you have a log viewer (like Console on Mac OS), you can view the log there. The only reason I suggest these options is that FlashTracer is pretty "crashy" ;)

like image 44
typeoneerror Avatar answered Oct 05 '22 18:10

typeoneerror