Hi! Thanks for visiting my blog. If you've received any value from my content would you mind supporting my new startup by downloading our browser add-on? It's called PriceBlink and makes online shopping a breeze. You can watch it in action here and download it for Chrome, Firefox, IE, or Safari by going to PriceBlink.com. Thank you and I hope you enjoy!

Using Flash 8 ExternalInterface for JavaScript Interaction

Jan 30

If you’ve done any Flash/JavaScript interaction then I’m sure you’re well aware of the different approaches you can take.  There’s getURL, fscommand, and the JavaScript Integration Kit.  While I’ve tried all three my new favorite is Flash 8′s ExternalInterface class.  This is by far the cleanest way to do Flash/JavaScript integration.

While this article goes into good detail of how to communicate in both directions, there’s one MAJOR piece missing.  I spent a good deal of time trying to debug my code thinking there was something wrong, but it turns out one of my object/embed parameters was incorrect.  Be sure to set the allowScriptAccess parameter to “always” because it’s set to “sameDomain” by default. I struggled with this in both Safari and Firefox.  After changing this parameter my code ran perfectly.

No comments

Trackbacks/Pingbacks

  1. [db75] » Blog Archive » Flex Ajax Bridge - [...] I recently posted about the ExternalInterface class in Flash 8, which allows for tight integration of Flash and JavaScript.  ...

Leave a Reply