Generate Flash

Published: 2005-04-04 10:30:30

I’ve transitioned to using Linux for work, finding some tasks quicker but facing challenges with Flash content generation. While MTASC offers a reliable ActionScript 2.0 compiler, it lacks pre-compilation. Ming, a PHP library for Flash, shows potential despite its outdated status. I aim to develop a small application using these tools soon.

Generate Flash

		I'm almost exclusively using Linux at work now. It's been working quite

well, many tasks can be achieved faster than on windows, other tasks can't be achieved at all :-)

One of those latter tasks is generating Flash content.

I did install Flash MX using Wine, and it runs. But I wouldn't call it fast, nor wouldn't I dare to describe it as 'stable'. So I only use it if I really only have to take care of small things - and even then it fails from time to time.

So I thought that it could be a good idea to switch from IDE-Based Flash development to Code-Based Flash development, just as I do it when developing Python or PHP/Html applications. In Flash one usually draws all the elements, creates transitions, writes some code, and lets the Flash compiler generate a nice SWF. That's what I thought. After I considered the process again, I realized that I - especially when developing Intranet-Applications - mostly create/draw the layout in Photoshop, export the elements to PNG24 from there, import those in Flash, and just use those thingies in Flash. Without doing almost any drawing at all.

That's of course a pretty bad way of doing things as the vector-based nature of Flash would allow for greatly reduced filesizes if I'd draw these Objects and Elements in Flash or any other Vector Software. But especially when developing Intranet-Applications, this reducement in load-time doesn't run up to the loss in development time I have when redrawing many of the Elements in Flash.

So, if most of my Flash usage is reduced to writing ActionScript and importing images anyway, why shouldn't I get rid of the Flash IDE at all (think Flash MX 2004 brrr) and completely code the whole application using Actionscript or something similar.


So I went on to explore the current state of open source ActionScript / SWF compilers. Here's what I found:


MTASC
:

MTASC is a complete commandline ActionScript 2.0 compiler. Multiplattform, quite bugfree and faster than the standard Flash compiler. Especially the multiplattform thing sounds nice since I use Mac OS X at home. I sincerely hope the AS2.0 implementation outstants the Flash MX 2004 one, as I've had severe problems with this one, mostly due to weird bugs in the compiler (like, compile-error: Wait, drink a cup of tea, try again - compiles!). One can even use Flash Components (although one needs to prepare things in Flash MX in order to do so). The whole idea sounds good, and it has a nice double double plus side: One doesn't need to learn another new language. It's all ActionScript - and if you're currently reading this you should be familiar with it.

However, one problem is that everything it produces is real-time SWF. There's nothing pre-compiled, every line, every textbox, every polygon has to be calculated and drawn at run-time on account of the User's cpu. (of course, one could include a seperate SWF-File filed with Objects and Elements, but that would require the Flash IDE again).

However, I still like MTASC alot, and I'll try to use it on some small future projects.


Ming:

Most people know ming. It's the standard PHP library for creating flash content. It provides a nice API, has included functions for importing Audio or Video, can include fonts, and even offers wrappers for various programming languages like c, c++, python, perl etc.

However, the last release is from 2004.02.02, and it seems (or smells) a bit stalled. So I checked their CVS and saw that there're still people actively working on the project (last commit I saw was something around 3 days ago).  I've had problems compiling the python extension before, and on the downside one needs to learn a new API in order to develop ming, but since most PHP distributions allow it anyway it would be a good thing to learn this if you're into PHP. I've used ming before (in order to create some commandline Flash generation utilities) and I'll eagerly wait for a new release.


SSWF:

SSWF is some sort of language in order to script SWF files. Looked good at a first glance, until I saw that including ActionScript works much like coding in Postscript. Using a weird stack and registers and whatnot. It includeds Mp3 support though. I'm not sure I'll ever use this, but might be just the right solution for someone out there.


f4l:

Flash for Linux. I first saw this in 2003 or 2004, and I'm not sure what I should think about this one. On the one hand it's nice that some people are developing something like the Flash IDE for Linux, and on the other did I write this whole article in order to find solutions which help in not using the Flash IDE anymore. So this one is quite abundant here, but I thought I'd include it anyway.


So.. That's it. I'll try to write a nice small application using either MTASC or Ming, soon - if I find some time, that is.