Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.
What Is AFLAX?
AFLAX<sup>tm</sup> stands for Asynchronous Flash and XML.
Defined simply, AFLAX is a development methodology which combines Ajax and Flash to create more dynamic web based applications.
What that means in more basic terms, is that this library provides a way to create and interact with Flash Objects directly from JavaScript.
Flash Objects offer visually stunning presentation, cross-browser persistent data, as well as a level of content protection.
Getting Started
You should be somewhat familiar with JavaScript and ActionScript.
Download the AFLAX distribution (from aflax.org)
Read the JavaScript source found in the distribution at: "/src/AFLAX/aflax.js"
Function Guide
By reading the aflax.js script, you will find out exactly how to go about using Aflax.
I will briefly explain the basic flow and functions.
(Documentation at the time of this writing is sparse at best.)
<b>1.
Initilize</b> You must first instantiate an object reference to the core AFLAX class, like so: <code>var aflax = new AFLAX ('/aflax/aflax.swf', false, true, onStoreDataCallback);</code>
Let's take a quick look at the parameters. 1.
<b>Swf path</b> - This is a relative path the the <i>aflax.swf</i> on your server from the distribution. 2.
<b>Trace</b> - This is a boolean value to define whether you want the actionscript tracing on/off. 3.
<b>Enable flash settings<b> - This is a boolean value to define whether or not you want to provide a settings window to the user to change the amount of data they want to allow flash to use, etc. 4.
<b>Local store ready callback</b> - This is a callback function that is executed when a store data method is called.
This 'aflax' object will serve as the single point of interaction for all your flash needs on a given web page.
<b>2.
Embed</b> Aflax provides some handy methods to embed flash objects into your web page document.
<b>insertFlash</b> You would use this method if you want to just append the Flash Object to the end of a document (absolute positioned elements), or if you are using inline scripting and want it inserted where your script tag is, for example: <code>aflax.insertFlash(400, 200, '#FFFFFF', callbackFunc, true, true);</code>
<b>addFlashToElement</b> If you know the container you want to replace the contents with a flash object with, use something like this: <code>aflax.addFlashToElement('DivContainer', 400, 200, '#FFFFFF', callbackFunc, true);</code>
<b>getHTML</b> Or, you can call the <b>getHTML</b> method directly, and then place it where you want, like so: <code>document.getElementById().innerHTML = aflax.getHTML(400, 200, '#FFFFFF', callbackFunc, true, false);</code>
<b>3.Interact</b> Now the fun starts.You can write your own javascript classes to manipulate the data in the flash object, call existing functions already compiled in any SWF (loaded with .loadMovie), etc.
<b>More to come</b> (Just a start, need to work on a project now!)