getURL and Flash 9

We upgraded our Flash players to the current version today and found a few slides on our sites didn’t work as expected.

When clicked, they were supposed to take you to other pages, but with the upgrade, old code was found to be broken.

Looking around, it appears the security model changed and we weren’t aware of this. I think it’s time to subscribe to the Flash RSS feed to keep on top of bug fixes and upgrades.

Anyway, it turned out our code could be fixed by just setting AllowScriptAccess to be “always” or “sameDomain”, depending on the application. In the <object> tag this was achieved by adding…

<param name="allowScriptAccess" value="always">

… and in the embed tag…

allowScriptAccess="always"

Those of you using SWFObject, the following JavaScript code does the trick…

so.addParam("allScriptAccess", "always");

This means when we call getURL() from ActionScript it is able to navigate to other pages on a foreign or the same domain.

There is a bit more information on this on the Adobe Flash knowledge base, Links from SWF files in HTML page no longer function (Flash Player 9).