Archive

Archive for February, 2011

Solution to getURL not working

February 22nd, 2011 No comments

A security enhancement was added to Flash Player sometime ago that disables getURL to function properly in Actionscript 2.0 of Adobe Flash. This could be an issue for some as in my situation when I created a banner for MET to celebrate the independence & liberation day of Kuwait.

The issue occurs if you are targeting a different domain than the current domain where the SWF/HTML file is hosted. I’ve also heard reports that it can occur if the SWF and HTML file are located at different location even if at the same domain host. I haven’t tested the latter so I can’t confirm or deny it.

Anyhow, to resolve this issue, all you have to do is change the allowScriptAccess attribute on the <object> tag to have the value “always”. You also have to add <param name="allowScriptAccess" value="always" /> or edit it to match it if it’s already there.

So at the end, your code has to look like this:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="955" height="88" id="SWFID" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="FILE.SWF" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="FILE.SWF" quality="high" bgcolor="#ffffff" width="955" height="88" name="SWFID" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>

This issue is explained in more detail at the official knowledge base of Adobe here and here.