Monday, November 7th, 2005
AFLAX: JavaScript Library for Macromedia Flash
>Paul Colton has created a new library, AFLAX, which is “a method through which developers may use JavaScript and Flash together to create AJAX-type applications, but with a much richer set of vector drawing controls than are available in either Internet Explorer or FireFox. Developers using this library have access to the full range of Flash features, but without ever touching the Flash IDE.”
Using AFLAX
Simply put the aflax.js and .swf in the right location, and point to the JavaScript file via:
<script type=”text/javascript” src=”aflax.js”></script>
Then create an instance of the main AFLAX class and give it the starter function:
var aflax = new AFLAX();
aflax.insertFlash(425, 250, "#FFFFFF", "go", false);
function go() {
// Start creating cool stuff here...
}
Examples
Some of these demos are CPU intensive as they perform real-time effects. They also require Flash 8 (as does the framework itself).
- Arrow with Motion Blur
- Ball with Motion Blur
- Animated Chart with Tooltips
- Text on Fire
- Glass Effect Demo
Take a peak at the JavaScript code needed for burning text
Related Content:












Why not just use something like the Motion-Twin ActionScript compiler (http://tech.motion-twin.com/mtasc.html) if you don’t have access to (or want to deal with) the Flash app? Flash already has XML Requests…
It would probably run a bit faster…
The idea is to not require any knowledge of ActionScript or even need an ActionScript compiler. You can do all your coding in JavaScript, which also means it will integrate seemlessly with your other JS, including ‘AJAX’.
i fail to see the point of this. why is this method any better than the flash javascript gateway introduced by macromedia? and why, indeed, would ajax even need to be used, as all browser calls can be called either directly in flash or with the aforementioned f-js gateway.
good job though, it’s always fun to dev new things :)
This is redundant.
There are built in functions that do this sort of stuff already as mentioned (XML, etc.)
ON TOP OF THAT…Actionscript has a lot in common with Javascript in terms of coding conventions. Obviously if you’re OOP challenged it gets trickier, but for most people that’s no issue…
This really does seem like a good idea, one major draw back though… No Linux/Unix support. Unfortunately Firefox / Mozilla support by macromedia flash is only at version 7. I’m not sure what their support on Mac is at, but I wouldn’t be surprised if it wasn’t the same.
Also, anyone on a 64bit currently has no support from macromedia. :o(
The good thing about projects like this, maybe this will put some pressure on Macromedia to start support for 64bit systems and 8.0version for Linux!!
“AFLAX needs Flash Player version 8.0 or higher”
… and there’s no Flash version 8.0 for Linux yet (only 7.0 is available) so this thing is unusable.
The real genius of this thing lies not in deployment, but in development and testing. I mean, who actually likes even having a compile step, let alone having to use the Flash IDE?
I do.
I think this is kinda cool. Things like this and AMASS are helping to reshape how we think about flash and what it can be used for. I’m still a big fan of but this is also pretty nifty.
Dont see the point in doing this. I can’t think of a good implementation for it. Also, has anyone noticed the major processor spike when loading the flash animation? All the demos spiked my processor out.
None the less is is always fun to play with stuff and come up with new ideas.
This is really neat.
I played with a JS -> Flash API for embedding and controlling sound from JS a while back (schillmania.com/projects/soundmanager/), and it worked decently well, but this is a whole new level of functionality.
It’s nice to see Flash 8 being (from what I’ve read,) more open to JS communication as well, previously it has been more difficult and less reliable.
> I do.
Same here. This goes in the same class as OpenLaszlo.
I’ve added some more demos, to include audio and video support.
http://www.aflax.org
I’m not a big fan of Javascript since it can be turned off.
Here’s an ActionScript IDE that works with mtasc compiler. Features class explorer, ActionScript API reference, autocomplete, and projects. SePy is GPL…
http://www.sephiroth.it/python/sepy.php