Home > actionscript > FYI ExternalInterface.available probably doesn’t do what you think

FYI ExternalInterface.available probably doesn’t do what you think

I think the general Flash Dev consensus is if ExternalInterface.available returns true that you can use ExternalInterface in the swf. This is actually not the case as this property does not check if your security sandbox allows you to use javascript. This is an important distinction for things like Flash widgets that can end up on 3rd party destinations like Facebook that re-write allowScriptAccess=”never”. You’ll need to always try/catch these calls to ensure a security sandbox error won’t break your swf. The closest to documentation on this I could find was this cautionary foot note in the docs which does not explicitly mention security sandbox issues:

NOTE The

 ExternalInterface.available

property reports whether the current container is a type that supports ExternalInterface connectivity. It will not tell you if JavaScript is enabled in the current browser.

Categories: actionscript Tags:
  1. June 11th, 2010 at 20:43 | #1

    Thanks. That’s what I suspected when my SWF broke on Facebook ;)

  1. No trackbacks yet.