use mtasc and ant to automate the thunderbolting of your swf files after the fact

20 views
Skip to first unread message

Loot

unread,
Jun 14, 2010, 6:17:59 PM6/14/10
to flash-thunderbolt
Hey all, I've been working on a new chumby project and really wanted
an adobe free tool-chain and found a great post by aral balkan about
that...

http://aralbalkan.com/408

To automate this process I created an ant build file to do this and it
works great with his demo except I wanted to debug in the browser with
thunderbolt because thunderbolt rocks. Eventually I realized I needed
a way to apply thunderbolt to the swf after it was created. This is a
quirk caused by the way this example is set up using mtasc to
precompile the classes and swfmill to then import and link them with
resources enabling a "natural" entrypoint for class instantiation.
Which I like alot as well.

Long story short, I realized using mtasc I could do just this,
basically leave the swf unchanged using the -keep flag and adding in
the thunderbolt with -trace.

The beautiful part of all this is that I can ignore thunderbolt in my
code writing and I can apply thunderbolt to ANY swf file. Now I can
have a production version built with swfmill and a dev version
produced from that swf meaning I don't have to pull things out of my
code before I do a production build.

Perhaps this is already know but thought I would share :-) see code
below. I would love to hear of anyone else using swfmill with
thunderbolt. Of course the ant file in this case is just a nice way to
package up a command-line call so you can easily do this without ant.
(actually I think less easily)

++++++++++++++++++++++++ ant build.xml ++++++++++++++++++++++++

<project default="addThunderbolt" name="Add Thunderbolt" >
<property name="mtasc.path" value="tools/mtasc-1.14" />
<target name="addThunderbolt">
<exec executable="${mtasc.path}/mtasc" failonerror="true">
<arg value="-v"/>

<arg value="-cp"/>
<arg value="src" />

<arg value="-swf" />
<arg value="bin/myFile.swf" />

<arg value="-keep"/>

<!-- thunderbolt needs this to access ExternalInterface -->
<arg value="-version"/>
<arg value="8"/>

<!-- set thunderbolt trace facility -->
<arg value="-trace"/>
<arg value="org.osflash.thunderbolt.Logger.trace"/>
<arg value="org/osflash/thunderbolt/Logger"/>
</exec>
</target>

</project>
Reply all
Reply to author
Forward
0 new messages