Tuesday, June 7th, 2005

Flash / JavaScript Integration Kit

Category: Flash, Toolkit

Macromedia has packaged a Flash / JavaScript Integration kit, which makes it possible to seamlessly communicate between Flash and JavaScript. You can call JavaScript functions from Flash, and ActionScript functions from JavaScript.

This kit gives us a great way to write Flash components that fit into our Ajax pages. Now, we are not forced to go the Flash way or the Ajax way. We can do both :)

Download the Flash / JavaScript Integration Kit


Demo of the kit working


Posted by Dion Almaer at 9:16 am

3.3 rating from 10 votes


Comments feed

It is exactly what I need for a current project, though I can’t seem to get it to work at all. I am getting the following error each time I try to export it:

**Error** C:\Documents and Settings\Liz\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\com\macromedia\javascript\JavaScriptProxy.as: Line 108: There is no property with the name ‘controller’.
receiving_lc.controller = this;

**Error** C:\Documents and Settings\Liz\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\com\macromedia\javascript\JavaScriptProxy.as: Line 110: There is no property with the name ‘callFlash’.
receiving_lc.callFlash = callFlash;

Total ActionScript Errors: 2 Reported Errors: 2

Moving the line:

var proxy:JavaScriptProxy = new JavaScriptProxy(_root.lcId, this);

to a frame or two into the movie gets rid of this error. But I still can’t access the actionscript functions.

The only working example I can find is the one on the macromedia site, but a really simple one would help me out no end. If anyone could point me in the direction of another working implentation I would be eternally grateful as the javascript/actionscript functionality doesn’t appear to be the sole focus of the example just mentioned. This looks like awesome functionality and I would really like to get this to work.



Comment by Kai — June 14, 2005

[…] We talked before about Adobe’s Flash / JavaScript bridge. They’ve taken it to the next level with a new Flex / JavaScript bridge. Whereas the original integration kit allowed for invocation of ActionScript functions and passing simple primitive values, this new bridge enables seamless integration of Flex applications with the browser’s JavaScript environment. The Flex DOM and ActionScript environment can be completely manipulated from the JavaScript environment and vice versa, and complex types can be marshalled across seamlessly. So now Dion’s crazy post on using Flash’s E4X API to do JavaScript DOM just got a wee bit more practical. ;-) […]

Pingback by Ajaxian » Adobe Announces a Flex / Ajax Bridge — March 7, 2006

I was using AFLAX, but it requires Flash 8. I was looking to replace it with something that does not have that requirement because my customers were having problems getting Flash 8 to work. I tried this gateway out last week and it did seem to work for most of my customers, but still had a few problems. It seemed to be some compatibility problems with Flash 8, maybe. Anyway, we figured out our Flash 8 install problems and switched back to AFLAX.

Actually, all we are using is the Socket connection part of the gateways, but it seems that AFLAX is way easier to install and get up and running.

Comment by Phill Kenoyer — March 7, 2006

Leave a comment

You must be logged in to post a comment.