Linking out of Flash embedded on MySpace, et. al.
Don't get your hopes up - you can't link directly from a Flash object in MySpace (Bebo, Facebook, etc.) or any other profile site that adds
allowScriptAccess="never"to your embed code.
But what if you want to create a link in a Flash widget that works when it can (like, on a blog), but display the URL and a "copy to clipboard" button when it can't (on MySpace)? This way, you don't have to force a user to choose between the version that links properly and one that doesn't (risking that the click-through-rate will be lower on the fallback solution.)
Here is the best way to detect the linking limitation, cross-browser:
- Make sure your embed code has
"always"(it defaults to
"sameDomain"). Be sure this is specified as an object-tag parameter as well as a param-tag name-value pair. MySpace will convert this to
- In ActionScript, call
flash.external.ExternalInterface.call("eval", "window.location.href = '[full url]';")
ExternalInterface.callmethod only works when
"always", otherwise it returns
null, so check for that.
nullis in fact returned, implement your fallback strategy (such as the one mentioned above.)
window.open()and pop-ups either — some pop-up blockers don't take clicks sent to embedded objects into account when determining whether a
window.open()was generated from a user-initiated event.