Nov 07, 2007

TextMate and mxmlc

A lot of the time, the only reason I have Flash open is to compile an fla which is completely empty except for the document class.

I have been playing with the mxmlc compiler and TextMate Bundles in an effort to create a workflow where I can create a project and compile an AS3 class into a swf straight from TextMate without Flash or FlexBuilder open. I started with the various build commands in the current Actionscript 3 Bundle and edited it so I could specify which class would be compiled and the name and location of the resulting swf. I am also working on commands for testing in adl (AIR debugger) and eventually I plan on creating a command to package AIR apps.

I will post all of it here as soon as it is post-worthy, so check back soon.

Share this Post


                           

Comments


Kylia     Oct 27, 2008
Thanks for writing this.

Emmly     Oct 23, 2008
Keep up the good work.

Luke Bayes     Dec 20, 2007
Just in case folks miss the link on my name above, the project is here

Luke Bayes     Dec 20, 2007
Another possibility is to use Sprouts. This is a utility that provides quite a lot of support for ActionScript 2, ActionScript 3 and MXML projects. One of the major benefits is that it provides rake tasks that automatically compile and run SWF files and then send trace output to the terminal. You can execute these (and collect trace output) directly from TextMate using the Ruby / Rake command in the Ruby bundle.

ian     Nov 21, 2007
i really, really, really look forward to your bundle. so finish it. now.

honestly, though, i need a solution that works better than cmd-Tab -> cmd-Enter, repeat, repeat, repeat.

Junio Vitorino     Nov 11, 2007
Hi guys, i'm now migrating to Mac and i'm yet searching apps than they can replace the than i was using in windows. A app than i had at windows than i'm feeling lack is FlashDevelop, then TextMate can be a exit on the Mac?

The Minister     Nov 08, 2007
Thanks for all the suggestions, and it's great to hear about other people's workflow when working in the Flash platform where there are so many tools and methods to get the same results. Again, I'll post the solution that I come up with when I'm happy with it, and would love to see other people's solutions.

@chris re:FlexBuilder
I can't stand the FlexBuilder interface, mostly because of a lot of small details, and some features of TextMate that I am addicted to. I do agree that the profiler is a nice feature (especially with the enhancements in 3), so I open FB at that point in a project and just run the swf in the debug player.

Simon     Nov 08, 2007
You should find that all you need to do is define a couple of project variables ( TM_FLEX_FILE_SPECS - the file you want to compile, and TM_FLEX_OUTPUT - the swf to create) then the bundle will handle everything else using mxmlc or fcsh and iTerm if they are installed.

At the moment I'm trying to find a workaround to get iTerm out of the equation and run the fcsh wrapper interactively but it's still not there yet. That way TextMate will be able to intercept and format the output - just like it does when it falls back on mxmlc only.

Monokai     Nov 08, 2007
Very interested in your solution. I hacked my own workflow together by customizing the AS3 bundle, but for FCSH to work, you need iTerm. And iTerm was quite buggy on my system. It's worth it to use FCSH though, it greatly speeds up compile time. I also used console.app for outputting trace() commands. All works right now, but the resulting workflow still feels a little bit McGuyver style :)

Chris Rebstock     Nov 08, 2007
I love textmate, and being able to code exclusively in that would be pretty sick.

In the meantime though, if all of your FLA's are empty except for a document class, why not just do a pure AS project in Flex Builder? You can get access to all the flash packages(via an fl package swc you can get at http://labs.thesedays.com/2007/04/16/flash-cs3-swc-for-flexbuilder/ ) and cs3 components (simple process that is explained at http://www.moock.org/blog/archives/000253.html ). Most importantly, you still get access to the debugger and the profiler. I've found both of them immensely helpful.

Nathan de Vries     Nov 07, 2007
Apologies, the link to fcwrap was incorrect in the previous comment.

Nathan de Vries     Nov 07, 2007
Be sure to check out the Flex Compiler Shell (FCSH). I use build system inspired by Yuichi Tateno's fcwrap, which compiles my SWFs whenever I save changes to the code, and then serves the SWFs via a local HTTP server.


Speak






Submit »