With a recent project we worked on, we really didn’t need the entire Flex framework, but did however desperately want to use the capabilities of the Flex-Ajax Bridge. After a little digging in the framework code and a little more testing, we found out that its completely possible to use the Flex-Ajax Bridge with standard AS3 projects as well. Quite possibly the name should be changed to Flash-Ajax Bridge instead. We used this with the original FABridge source that was released quite a while ago, but right before posting this I tested it with the latest Flex Builder 3 Beta (which finally includes the code, so you don’t have to search random sites for it).
Note: I’m really not sure how this fits in with the EULA, so use at your own risk.
With the latest Flex Builder 3 Beta, copy the following sourcecode from the frameworks directory and paste them into your AS3 project source directory:
to: your bin/js/ directory
Once you get those 6 classes and 1 js file into your AS3 project, you’re good to go!
To test, in your AS3 project base class create a new FABridge instance, then set the rootObject property of the instance to “this” (the base class reference). Give the bridgeName property of the instance a name and then in js you reference the flash bridge with that name, like the following: FABridge.[bridge name].root(). Now follow along to the tutorials on the Labs page.
That’s it… nothing to it.
Just remember, until we find out some more information regarding the EULA on this topic, use at your own risk.