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
allowScriptAccessset to"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"never"properly. - In ActionScript, call
flash.external.ExternalInterface.call("eval", "window.location.href = '[full url]';") - The
ExternalInterface.callmethod only works whenallowScriptAccessis"always", otherwise it returnsnull, so check for that. - If
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.
