SWF Console - A Flash movie player for developers

Copyright © 2005, Ricci Adams. Released under the GNU General Public License.

How do I obtain SWF Console?

Download binary (Version 0.9.0, 4/12/2005)

What is SWF Console?

SWF Console is a Mac OS X application that displays both a Flash movie and any debugging messages that the movie generates. It also serves as a centralized location for running flare, flasm, and swfdump.

How do I display messages in SWF Console?

In your Flash movie, define the following function and then call it with your message:

function println(message) {
    getURL("javascript:showText('" + message + "')");
}

Why not use AdminTool to debug?

While AdminTool is a very powerful debugging environment, it was simply overkill for my daily debuging needs.

How did you get a Flash movie to send a message to a Cocoa NSTextView?

The basic idea is to go from Flash to Javascript to WebKit's WebUIDelegate to Cocoa's NSTextView:

I would like to use Apple's Xcode, mtasc, and SWF Console for my development environment. What is the best way to integrate these three applications?

My method for doing this is listed below. This is the best way that I have found; however, it may or may not fit with your project management style.

First, create a project directory structure similar to the following:

/Project
    /build
        /build.swf
    /base
        /base.fla
        /base.swf
    /Main.as
    /Controller.as
    /MyClass.as
    /Project.xcode

base/base.swf is a Flash movie which contains all graphical objects. These reside both in the library or on the stage as instances. The Xcode project has a single Shell-script Target, which looks similar to the following:

rm ./build/build.swf
cp ./base/base.swf ./build/build.swf

PATH_TO_MTASC \
    -cp PATH_TO_STD_DIR \
    -swf ./build/build.swf \
    -main Main.as

error=$?

if [ $error = 0 ]; then
    open -a "SWF Console" ./build/build.swf
else
    exit $error
fi

Thus, when you click "Build" in Xcode, the previous build results are removed. Next, base.swf is copied to the new build.swf file. mtasc then runs and compiles the code into build.swf. If the build was a success, SWF Console launches. If not, an error is displayed in Xcode.

How can I contact the author?

To contact me, please use the contact page on my music website.