Flash IDE Compile Ant Script

I’ve gotten used to using Ant in FlashDevelop for my AS3 compiling, but I also do a bit of work in the Flash IDE, so I hated having to switch over to a different shortcut key/button to compile in Flash. The solution was to make another Ant project with a different build.xml file. It’s a bit of a no-brainer, but I’ll post it here for anyone who is interested. Ant rocks.

[xml]





[/xml]

If anyone wants the full project files, let me know. I’m not going to go through the trouble of zipping and uploading them, because I think I’m the last person on the planet to actually use the Flash 8 IDE for development.

This entry was posted in Flash. Bookmark the permalink.

7 Responses to Flash IDE Compile Ant Script

  1. C4RL05 says:

    There’s a lot of us using the Flash IDE for development. You’ll be surprised.

    I recently switched to FD, but still use the Flash IDE for building and laying out the assets. I really like this workflow. It reminds me of Dreamweaver’s design and code modes. Something among those lines would be great for the Flash 9 IDE.

  2. Hi Keith,
    for someone who is new to Ant could you explain what this script does? Well, I think I get it (it compiles but could you elaborate on the jsfl line?
    And then what does the process for running this look like from within Flash (if that’s what you do)?

    I’m using FlashDevelop myself (as well as Eclipse as well as the Flash IDE) so I set myself up with the same compile shortcut in all 3 programs 🙂
    I bet your Ant way is better though – everyone seems to use it but me 🙂

    Thx

    Stefan

  3. kp says:

    Sure, it’s pretty simple. Starts with the project tag. That has a default attribute which is “compile” and refers to the target node with the name “compile”. This target will be run as a default target.

    Two properties are set. This is just the same as setting variables. So you don’t have to type out the full path to the tools each time.

    A target is like a function. Since the compile target is default it will run automatically. It has an exec node which is an executable program, namely flash.exe.

    The exec node has arg nodes to pass parameters to the executable.

    So all it is really doing is calling flash and giving it a path to a jsfl script. Same as saying:

    flash.exe testmovie.jsfl

    but with all the paths intact. Flash will execute the jsfl script which mostly just consists of a call to the testMovie() function. So the result is the same as if you switched to Flash and pressed control-enter. 🙂

    But as I said, this ant build file is really simple. Ant can do all kinds of things: moving, deleting files, creating directories, zipping and unzipping files, ftp functions, source control integration, etc. Plus it can integrate with Java classes to do even more things. The one we use for our build process at work is something like 3000 lines!

  4. Mike Britton says:

    I’m doing the same thing with Flex. Ant is the best scm tool I’ve ever used, bar none.

  5. Bill says:

    Those of you using Ant to compile… I’m using Nant (.net port of ant) and I’m trying to do unattended builds in Windows. I’m finding that Flash isn’t able to embeded fonts when running under a system account as a service. If I actually log in as my account it works, but if I run a build service under my account it no longer find the fonts.

    Anyone have the same issues and/or a solution?

  6. André says:

    Hi Keith, meanwhile you are on mac, aren´t you?. how do you open the flash player with ant mxml on a mac. I spent hours of googleing and can´t find any solutions. Thanks so much if you can post a solution. cheers from Berlin.

  7. Craig says:

    Hey André,

    I was having the same problem and found the solution here;

    http://www.eyefodder.com/blog/2007/06/cruisecontrol_on_the_mac_modif.shtml

Leave a Reply