Compiling Flex2 from FlashDevelop
April 20th, 2006
I mentioned in my last post that I’ve played around with Flex 2 and FlashDevelop. I wanted to briefly follow up on that by sharing what I added to my toolbar in FlashDevelop. There are a few posts on the FD forums which go over how to add your own toolbar or menu options which is super easy since they’re driven off of some xml files.
Assuming you already know what Ant is and you have it installed, you can easily create a build.xml file which will send off your mxml or actionscript to the Flex compiler, magically producing a finished Flex app. I wanted to add a shortcut to my toolbar in FD so that I didn’t have to keep an extra window open to run ant so I add the following to my ToolBar.xml file in FD:
<button label="ANT" click="RunProcessCaptured" image="23" tag="C:\windows\system32\cmd.exe;/k ant" />
Add it wherever you like, I just added it right next to the command prompt button which I basically just copied. All I added was the /k ant which tells the command prompt to run the command “ant” when it launches.
Update: I changed the above code snippet to reflect some input from Philippe. Now the output from the command prompt window is directed to the output panel in FD. You might have to change your path to cmd.exe, but most likely not.
Regarding the build file, I just copied the one Sam made and modified it for my own use.
If you want to copy mine to get started, here it is:
build.xml
The property name “source” refers the name of the mxml or as file you want to send to the compiler and “ext” is the extension, since you can send either an as file or an mxml.
Currently residing in Scituate, MA and working at
April 20th, 2006 at 9:42 am
Wow cheers for pointing that one out bro, I have been hoping something would happen here. Good work and cheers for sharing.
April 20th, 2006 at 10:07 am
You can also have ANT’s output captured in the output panel:
April 20th, 2006 at 10:07 am
(xml was stripped)
button label=”ANT” click=”RunProcessCaptured” tag=”C:\WINDOWS\SYSTEM32\CMD.EXE;/k ant”
April 20th, 2006 at 10:17 am
Sweet. I haven’t taken the time to learn what all those attributes did. It was simply a case of “maybe I’ll copy this button and change it a little”.
April 20th, 2006 at 11:19 am
Thats great! I just started thinking about doing the same thing so this example will help me a lot. Thanks!
Any chance that someone has started work on an Ant or NAnt task for the Flex2 compiler?
April 20th, 2006 at 11:49 am
I don’t suppose FD has code hinting for MXML or AS3 yet, does it?
April 20th, 2006 at 2:43 pm
Ben, it doesn’t support it right now, but it sounds like there will be an effort to add support for this when flex2 and as3 is released as a final candidate.
April 21st, 2006 at 8:07 am
Will FD (or any other ide) allow debugging a Flex 2 project ?
Since everything around Flex 2 will be free of charge (except the Builder)
this theoretically should be possible.
If efforts are made in this direction this would be great.
Regards
valley
April 21st, 2006 at 8:48 am
Good question. I’ve been wondering as of late what kind of development effort it will take to have an opensource debugger to compliment the free, standalone compiler. For serious Flex development, obviously one wouldn’t want to give that up so it remains to be seen whether serious flex development will happen outside of the builder.
At least for me right now, I wouldn’t mind the lack of a debugger because I still have to get into the habit of using the one in the builder now! I still find my old flash habits of tracing out values of things sneaking into my development workflow. I’m trying to realize I don’t need to do some of these things anymore
April 21st, 2006 at 5:43 pm
I’ve noticed that there aren’t many powerful visual debuggers for *any* language. It’s probably one of the more difficult parts of building a development environment. I know there’s some work on an AS2 debugger (though I don’t remember what it’s called). I’m curious how different the debug SWFs are for Flash 9 and AVM2.
April 22nd, 2006 at 2:46 pm
Well the point is that my AS2 projects (using FAMES) currently have reached a size where it’s really hard to find and solve errors with trace statements.
That’s why I would really appreciate an open source ide for Flex 2 projects that
will allow comfortable debugging projects.
With Flash 7 (and below) projects this wasn’t possible, as it seems, but I
strongly hope that there will be an open description for the SWD (or whatever the name will be in Flex 2) files that can be used for debuggers outside FlexBuilder.
If not, then I really have to think about purchasing FlexBuilder, since the debugger looks quite ok for me, but I would prefer an ide that costs nothing
April 24th, 2006 at 12:25 pm
[...] Thank to Tim Walling (he opened the way) http://www.timwalling.com/2006/04/20/compiling-flex2-from-flashdevelop/ [...]
October 18th, 2007 at 2:35 pm
Hi,
I have a flex application, and I need to compile it to run with Flash Player 7.
Someone can tell me if it’s possible to do, if it’s possible, how can I do that.
Regards.
May 5th, 2008 at 6:27 am
Marcelo, Flex 2 requires Flash Player 9 since it uses Actionscript 3.