July 2005 Archives

UPDATE (2007-02-09):
CHANGES:
1) Added Linux info
2) Changed mm.cfg file location for Windows 2000
3) Made corrections to Step 4
UPDATE (2006-11-17):
CHANGES:
1) As of Flash Player version 9,0,28,0, the default location of flashlog.txt has changed and cannot be modified
UPDATE (2006-01-19):
CHANGES:
1) Changed the property order in mm.cfg
The original order would sometimes change the name of the flashlog on mac.
2) Changed MaxWarnings from 100 to 0
This allows an unlimited number of error messages to be written to the flashlog.
3) Changed which tail software I recommend for Windows
I have settled on the tail that is included with Windows Server 2003 Resource Kit Tools. It's native to Windows, easier to install than cygwin, and more stable than Tail XP.
Some great 3rd party debug tools have been released in the past few months that expand upon the standard trace() in Flash. I recently wrote about one of them. Unfortunately, I've noticed myself not using these tools as often as I would like because its usually easier and quicker to just use trace(). The biggest drawback about trace, however, is that there's no way to output from the browser ... or is there?
The other day I stumbled upon an article by Josh Buhler at actionscript.org that shows you how to install the Flash Debug Player that's buried in the application folders of Flash. The Debug Player, along with a text file, allows you to view standard traces from a swf in the browser. Now, if you've already read his article skip on down to the bottom of this page because I've added a step that will make you even happier. If you haven't read his article yet, go on what are you waiting for? If, on the other hand, you like step-by-step instructions that get you up and running the fastest, I've recapped his process below. I've done this on both the mac and pc and can't live without it now.
1) Uninstall your Flash Player
Find the uninstaller here: Adobe Flash Player Uninstallers.
Even though this is the first step, this is the one that you're going to question the most, should I really uninstall my Flash Player and install the Debug Player? The answer is an emphatic "yes". The Flash Debug Player is the exact same player with a very nice extra feature.
2) Install the Flash Debug Player
Find the installer here: Adobe Flash Debug Players
3) Verify installation of the Flash Debug Player
Restart your browser and right-click (ctrl-click) on a swf. You should have the "Debugger" option in the context menu, like the example below. Flash Debug Player
4a) Create a text file named "mm.cfg"
Save the file here:
OSX -
MacHD:Library:Application Support:Macromedia:mm.cfg
Windows XP -
C:\Documents and Settings\username\mm.cfg
Windows 2000 -
C:\mm.cfg
Linux -
home/username/mm.cfg
4b) Add properties to mm.cfg
ErrorReportingEnable=0
TraceOutputFileEnable=1
MaxWarnings=0
FLASH DEBUG PLAYERS 9,0,28,0 AND NEWER
4c) The property TraceOutputFileName is no longer needed in mm.cfg. The default location of flashlog.txt has changed and cannot be modified from the following locations:
OSX -
MacHD:Users:username:Library:Preferences:Macromedia:Flash Player:Logs:flashlog.txt
Windows -
C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs\flashlog.txt
Linux -
home/username/Macromedia/Flash_Player/Logs/flashlog.txt
FLASH DEBUG PLAYERS 9,0,16,0 AND OLDER
4c) Add the property TraceOutputFileName to mm.cfg
OSX -
TraceOutputFileName=MacHD:Users:username:Desktop:flashlog.txt
Windows -
TraceOutputFileName=C:\Documents and Settings\username\Desktop\flashlog.txt
ALL FLASH DEBUG PLAYERS
5) Test the Flash Debug Player
Either publish a swf that uses trace() and view it in the browser, or surf around and find out what other people have been tracing in their movies (that's one of my favorite options). The traces have been output from the browser to the text file. Open up flashlog.txt and see for yourself, you know you want to.
And there you go. I'm sure many of you are extremely happy right now, and you should be, this is a great tip. But after a few uses, you're going to get really annoyed opening and closing the text file to view the new traces ... if only there was a way to view the text file being updated in real time like the Output window in Flash. Here's the new step that will make you rejoice.
NEW STEP ...
6) View the text file updating in real time
OSX -
Open Terminal
At the prompt type:
>> cd <path to flashlog's directory>
>> tail -f flashlog.txt
Windows -
Go to Windows Server 2003 Tools, and download Windows Server 2003 Resource Kit Tools near the bottom of the page. Although it says Windows Server 2003 all over the page, its also made for Windows XP.
Install
Open Command Prompt
At the prompt type:
> cd <path to flashlog's directory>
> tail -f flashlog.txt
Browse to a swf online that uses trace() and watch the magic. Terminal and Command Prompt display the contents of flashlog.txt as it changes ... its just like having Flash's Output window, except this one works in the browser!!
Isn't this great? Like I said earlier, I've gotten this to work on both the mac and the pc and can't live without it now. If you have any questions about these steps, feel free to email me or comment below and I'll be glad to help.
OPTIONAL WINDOWS STEPS ...
7) Create a batch file to quickly load up the flashlog in tail
Create a text file and rename it flashlog.bat
Right-click on the batch file and select "Edit"
Add the following content to flashlog.bat:
cd <path to flashlog's directory>
tail -f flashlog.txt
Double-click on the batch file to see it working.
8) Create a shortcut to the batch file to set the Command Prompt colors and options
Right-click on the batch file and select "Create Shortcut"
Right-click on the shortcut and select "Properties"
To view the Command Prompt maximized change the pulldown under "Run:"
To change the colors of the Command Prompt select the "Colors" tab
Unfortunately the "Font" tab options are very limited
Under the "Options" tab, select "QuickEdit mode" to be able to easily select and copy and paste
Tip for copying and pasting in the Command Prompt:
Select the text you want to copy and then right-click it, this puts the selected text into the clipboard ... now just hit ctrl-v or paste in any other program.
Close out of the properties and double-click on the shortcut to see the flashlog with your colors and options.

July 2008

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Categories

Archives