Copyright © 2005, Ricci Adams. Released under the GNU General Public License.
Download binary (Version 0.9.0, 4/12/2005)
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.
In your Flash movie, define the following function and then call it with your message:
function println(message) {
getURL("javascript:showText('" + message + "')");
}
While AdminTool is a very powerful debugging environment, it was simply overkill for my daily debuging needs.
The basic idea is to go from Flash to Javascript to WebKit's WebUIDelegate to Cocoa's NSTextView:
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.
To contact me, please use the contact page on my music website.