PrimalScript, now with Flex2 and AS3!

A few days ago, Sam posted about compiling Flex 2 and AS3 via Ant in PrimalScript. Well, his setup is now an official part of PrimalScript 4.0! Can’t say those boys at Sapien don’t respond to customer requests.

Here’s how it works:

1. Create a New Project. You can choose AS3 or Flex 2:

2. PrimalScript sets up the project directory, creates a basic class or mxml file and build.xml file, along with a bin dir and html file, all keyed to your project name:

3. Here’s a glimpse of the build.xml file it creates. You are free to customize this however you want, adding additional parameters, etc.

4. You’ll need to have Apache Ant set up and the Ant folder should be in your path. More info on how to set that up here. You can then set up PS to execute Ant when you hit F7, keying it to the ActionScript and/or Flex file types. Set it up like so in Options:

5. Now, hit F7 and watch your project compile:

6. When it’s done, the swf will open up right in a new tab:

You are also free to have it open up in the standalone player if you want. Just change the player variable at the start of the build file to contain the path to the player. Alternately, you could have the html file launch.

Of course, this set up isn’t 100% workable for large projects, as there is still no code hinting, etc. But that will be along shortly. Still, it’s a first step and very exciting. And as soon as the free Flex 2 beta is no longer beta, and no longer free, this will be pretty useful for anyone who wants to work with the free command line compiler without paying for Flex Builder 2.

This entry was posted in Flash. Bookmark the permalink.

6 Responses to PrimalScript, now with Flex2 and AS3!

  1. Ben says:

    Any news on when PS4 will be released?

  2. Ben says:

    Woops, I meant 4.1 but going back and reading carefully I see you said 4.0. I guess it just requires the latest update? While we are on the subject, the tedium involved in making the minor upgrades is one of my only complaints about PS.

  3. kp says:

    yes, it’s in the latest service release of 4.0: 4.0.493 I think. If you have PS, just do Help/Check for updates… and you should be directed to the site to download the latest release.

  4. JLM says:

    Is that the standard one you use?

  5. kp says:

    I use Enterprise, but this should all work in standard or professional too.

  6. Steve says:

    I have been coding mxml and actionscript with ps now for about almost a year and love it. I come from the homesite/cf studio crowd, and love that type of simplicity. I recommend cfers and anyone getting into flex to take ps for a spin.

Leave a Reply