Hi all,

If you like to take a little coffeebreak during compilation of your flash 
application ;):

A little ant script which publishes all your files in your e.g fla folder with 
MM compiler.
Needs ant-contrib installed http://ant-contrib.sourceforge.net/.

<project name="Simple Flash Ant Task" default="publish_all" basedir=".">

<taskdef resource="net/sf/antcontrib/antlib.xml"/>

<property name="flashmx2004" location="C:\Programme\Macromedia\Flash MX 
2004\Flash.exe"/>
<property name="fla.dir" location="fla"/>
<property name="jsfl.dir" location="jsfl"/>
<property name="publish_all" location="${jsfl.dir}/publish_all.jsfl"/>

<target name="publish_all" description="Publishs all Flash files in project fla 
folder">
        <delete file="${publish_all}"/>
        <for param="file">
                <fileset dir="${fla.dir}" id="id">
                        <include name="*.fla"/>
                </fileset>
                <sequential>
                        <propertyregex property="filename" input="@{file}" 
replace="" regexp="(.*)\\" override="yes" />
                        <concat destfile="${publish_all}" append="true" 
encoding="UTF-8">var filename = "file:///../fla/{filename}";</concat>
                                <concat destfile="${publish_all}" append="true" 
encoding="UTF-8">fl.openDocument(filename);</concat>
                                <concat destfile="${publish_all}" append="true" 
encoding="UTF-8">var curr_doc = fl.getDocumentDOM();</concat>
                                <concat destfile="${publish_all}" append="true" 
encoding="UTF-8">curr_doc.publish();</concat>
                        </sequential>
                </for>
                <exec executable="${flashmx2004}" failonerror="true">
                        <arg value="${publish_all}"/>
                </exec>
        </target>
</project>

It simple calls Flash.exe with an jsfl file as argument like Keith mentioned in 
his blog(http://www.bit-101.com/blog/archives/000012.html). 

greez

Chris
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to