See trace() of Flash when running in browser
Asked Answered
S

9

27

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

Spinthariscope answered 14/5, 2009 at 15:51 Comment(0)
S
25

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.

Spinthariscope answered 14/5, 2009 at 16:23 Comment(6)
This answer needs updating - the "official steps" link is dead, and FlashTracer hasn't been updated since July 2008.Liquor
It doesn't look like FlashTracer plugin has been updated for the latest version of Firefox. However I did find a handy standalone GUI at code.google.com/p/flash-tracerMystique
You can just open the flashlog.txt; there's no need for a separate plugin to read it.Bencion
Another possible alternative to FlashTracer is FlashFirebug. addons.mozilla.org/en-US/firefox/addon/flashfirebug Though I couldn't get it to work (might be a licensing issue), so ended up using Vizzy mentioned above. Also ran across this post on how to get Vizzy working in Chrome: burnedouthippy.com/2011/02/…Newmark
Or simply use import flash.external.*; /*....*/ ExternalInterface.call('console.log', 'this was very tricky'); along with trace?Furlough
It's good that you updated the "official steps" link, but you should also describe those steps here, in case the link goes offline again. StackOverflow guidelines also encourage this: stackoverflow.com/help/how-to-answer . You don't have to quote the entire page, just the relevant info (how to enable trace logging)Enscroll
B
16

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);
        }
    }
Bidentate answered 19/4, 2012 at 14:39 Comment(1)
You also need to import flash.utils.getQualifiedClassName;.Innervate
B
13

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" ;)

Buonarroti answered 15/5, 2009 at 3:2 Comment(3)
Not perfect since it only caters to AIR and AS3 apps.Spinthariscope
Ha, ok. What, if anything in life, is perfect?Buonarroti
Wow. I wish I had found this 2 years ago. It just goes to show you that, as programmers, we are so used watching shell output fly by that we sometimes forget how nice a well engineered GUI debugger can be.Often
W
4

Vizzy makes life easier if you want a basic logfile viewer. You just install the debug player and then install Vizzy. It is a window that tails the flashlog file. The sweet thing is that is does all the mm.cfg file b.s. for you.

http://code.google.com/p/flash-tracer/

Wampum answered 15/4, 2010 at 20:42 Comment(1)
Easy to use tool. Once a debug flash player is installed, no configuration is needed. All done by Vizzy. Browser independent. Cool tool.Erhard
L
3

Probably not as fancy as the others or cutting edge, but I used to create my own log function in the flash movie (funnily enough, called log) that called trace and also called a js function on the page (using whatever method your comfortable with). The function on the page was just a simple console.log() with Firebug. Simple and worked a treat.

Latashalatashia answered 15/5, 2009 at 3:18 Comment(0)
S
2

I am a happy Thunderbolt user, maybe it is also worth a look (multiple log levels, plays nicely with firebug out of the box).

Sorrows answered 22/5, 2009 at 10:28 Comment(0)
B
0

Since macromedia was aquired by adobe,I thought it should be 'D :\Documents and Settings\user_name\Application Data\Adobe\Flash Player\Logs\flashlog.txt '.Which resutlted in loss of few minutes for me.Finally i decide to give it a try to look at D:\Documents and Settings\user_name\Application Data\Macromedia\Flash Player\Logs\flashlog.txt and bingo i could see the flash trace() outputs.

I wonder why adobe is sill keeping the log file location in macromedia folder.Whatever it is I can see the trace ouptuts of flash applications run inside a browser and i am a happy man :)

Brumley answered 26/9, 2009 at 5:59 Comment(0)
P
0

In windows, If you use a localized version (i.e. spanish) of the operating system, 'Application Data' must be replaced with the localized version (i.e. "Datos de programa")

Perfusion answered 15/7, 2010 at 8:56 Comment(0)
A
0

Unix's tail command works well for me:

tail -f ~/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt

The -f switch keeps the log open and tails it via stdout into an open Terminal window. This is a Mac solution, I'm not sure what the Windows tail equivalent is.

Note that path is based on this document, posted above by @Jarvis.

Ailis answered 20/5, 2014 at 23:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.