The Flex-Ajax Bridge is a wonderful little code library that completely opens up a swf to be controlled via JavaScript. Quoting the Flex-Ajax Bridge Labs page, “essentially anything you can do with ActionScript, you can do with JavaScript.” At least as far as I know, up until now this has been limited to use with the Flex framework and could not be used with a standard AS3 project.
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:
1) FABridge.as
from: /sdks/3.0.0/frameworks/javascript/fabridge/src/bridge/
to: bridge/
2) FABridge.js
from: /sdks/3.0.0/frameworks/javascript/fabridge/src/bridge/
to: your bin/js/ directory
3) IMXMLObject.as
from: /sdks/3.0.0/frameworks/projects/framework/src/mx/core/
to: mx/core/
4) Version.as
from: /sdks/3.0.0/frameworks/projects/framework/src/mx/core/
to: mx/core/
5) mx_internal.as
from: /sdks/3.0.0/frameworks/projects/framework/src/mx/core/
to: mx/core/
6) ItemPendingError.as
from: /sdks/3.0.0/frameworks/projects/framework/src/mx/collections/errors/
to: mx/collections/errors/
7) IResponder.as
from: /sdks/3.0.0/frameworks/projects/framework/src/mx/rpc/
to: mx/rpc/
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.
A little over a month ago I wrote about how FlashPaper seemed like it was taking its last dying breath. After reading the comments and doing some searching on my own,
Share currently seems to be the only continuation of FlashPaper in any form by Adobe. This was a little disappointing since Share is definitely not FlashPaper. Share (much like its name states) is basically a document sharing product that offers an embeddable preview of the document that you can embed on your site. The keyword there is “preview”. The preview is very basic and doesn’t give you any controls besides changing the page. The only way to actually look at the document in all of its glory, with some of the old FlashPaper controls, is to click on the preview which links the user back to Share’s website where the actual document is hosted. Unfortunately this is very limiting and annoying to people who are used to being able to embed the entire FlashPaper application in their own page.
A month and a half later and along comes a new tool to possibly fill the void left by FlashPaper.
Scribd, another document sharing website competing with Share, has released their own version of FlashPaper called iPaper. At first glance, iPaper seems to be everything I was hoping FlashPaper 3 would be. It offers all of the tools that FlashPaper 2 offered, including embedding the entire application, plus some:
But the thing that caught my eye the most (that I still need to investigate further) is that Scribd offers a full API.
From their site: “Use the Scribd API to harness the full power of Scribd’s scalable conversion system, storage system, ad network, search engine, and iPaper viewer on your website at no cost to you.”
Looks like you will be able to control all of iPaper’s controls through an API much like FlashPaper allowed.
This is very exciting and I can’t wait to dig deeper into it and see if there is a need for a component at all anymore. One thing I do see the need for though is an AS3 library to communicate with Scribd’s API.
So I started AS3ScribdLib.
Nothing has been added yet, but keep your eye out and hopefully it will be coming soon.