Monday, November 7th, 2005

AFLAX: JavaScript Library for Macromedia Flash

Category: Flash, Toolkit

>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).

Download AFLAX

Take a peak at the JavaScript code needed for burning text

aflax-burning

Related Content:

Posted by Dion Almaer at 9:06 am
14 Comments

+++--
3.3 rating from 9 votes

14 Comments »

Comments feed

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…

Comment by Shawn — November 7, 2005

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’.

Comment by Paul Colton — November 7, 2005

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 :)

Comment by michael — November 7, 2005

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…

Comment by Anon — November 7, 2005

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!!

Comment by Dustin — November 7, 2005

“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.

Comment by Jon — November 7, 2005

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?

Comment by misuba — November 7, 2005

I do.

Comment by Brian — November 7, 2005

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.

Comment by Andrew Wooldridge — November 8, 2005

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.

Comment by Dave — November 8, 2005

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.

Comment by Scott Schiller — November 9, 2005

> I do.

Same here. This goes in the same class as OpenLaszlo.

Comment by Shawn — November 9, 2005

I’ve added some more demos, to include audio and video support.

http://www.aflax.org

Comment by Paul Colton — November 10, 2005

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

Comment by Mo — December 5, 2005

Leave a comment

You must be logged in to post a comment.