Posts tagged "flash_javascript"

Changes to the Flash / JavaScript Integration Kit

Over the last couple of days, we’ve made several changes to the Flash / JavaScript Integration Kit. If you are using the Integration Kit, or if you’re interested in using it, I strongly recommend grabbing the latest code out of Subversion.

Here is a list of the changes we’ve been working on:

  1. The Integration Kit now uses FSCommand to go from Flash to JavaScript on Internet Explorer on Windows. Using getURL causes several issues on IE, and we found that FSCommand works much better in that environment. You will no longer get that odd clicking sound that IE likes to make when you click on a link, and the kit will no longer cause open sockets (images in the process of loading, XMLHttpRequest sockets, etc) to be prematurely closed.
  2. We added the ability to handle multiple consecutive calls from JavaScript to Flash. Before, if you tried to make multiple consecutive calls, typically just the last one would succeed. Now, not only can you make as many calls as you want, but all the calls are guaranteed to happen in the correct order. (Basically we added a queuing mechanism to the JavaScript.)
  3. We added an optional scope argument to the FlashProxy. This allows you to specify the JavaScript scope (object instance) that you want to call functions on from Flash. This argument is entirely optional, and leaving it out will result in the kit working just as it did before (calling functions within the document scope).
  4. We fixed a bug that was breaking function calls from Flash to JavaScript when passing strings with single quotes in them.
  5. We added support for Opera 8.0 and higher (at least that’s what we tested on — it might work with earlier versions) on both Mac and Windows.

There is one additional issue with respect to getURL and FSCommand I need to explain. If your Flash content is compiled for Flash Player 7 or higher, the Integration Kit will automatically use FSCommand where appropriate and getURL everywhere else. This is definitely the recommend usage. If your content is compiled for Flash Player 6, getURL will be used universally. That doesn’t mean it won’t work in IE on Windows, but it doesn’t work nearly as smoothly as FSCommand. The bottom line is that if you can compile for Flash Player 7 (which now has more than 90% penetration), you should do so.

We have not done another official release of the Integration Kit with all these changes yet. Right now, the official release is pretty old code with lots of issues, so we definitely recommend using the newest code from Subversion. We hope to do another official release of both the code and documentation very soon (maybe next week).

Let me know if you discover any issues so we can get them fixed before the next official release.