Actionscript "flash player has stopped a potentially unsafe operation" fix

When I program in actionscript I have to ba aware of the various updates each version of the plugin has. One new security feature(?) is when accessing an external url new versions of the plugin pop up with a security message:

"flash player has stopped a potentially unsafe operation"
well thats a pain in the @*$% if you have made a bunch of getUrl links in your script.
Anyway here is a workaround:
lets say I want to have 2 links, one to and one to hosted on my site I would usually have a line such as
getURL("", _blank
getURL("", _blank)
each referenced to a button.
Unfortunately this no longer is feasible because of the new popup "feature".
local urls are fine ie.
will get the local url and the path /lovers/ like so:
So with a little help from php we call a helper script like so:
in the root of our php installed web server create the file helper.php:

/* Simple forwading helper to external urls */

/* =========================== */
/* */
/* Copyright(c)2008 Bernard Edlington bernard(at) */
/* */
/* */

// the following gets the url var passed to php and makes sure its lower case
$urlpass = strtolower($_GET['url']);
if ($urlpass == "foobar"){
header( "Location:" );
}elseif ($urlpass == "google"){
header( "Location:" );
// for safety this last line will push all other vars to our web root
header( "Location: /" );
Note similarly we could use javascript, asp, even modRewrite etc.. I just like php. The concept is always the same actionscript -> local url -> external url.
See no need for that silly security "feature" afterall.


  • December 24, 2008 at 5:33 AM | Permalink

    Great post Bernard. Thank you a lot. I was looking for a solution like this.

    John N.

  • December 24, 2008 at 6:28 AM | Permalink

    I might have found an easier solution.
    Check the publish settings of your .fla.
    Change the Local playback security from "Access local files only" to "Access network only".
    After a new swf export I got also rid of this error message without using helper.php.

    John N.

  • February 5, 2009 at 10:15 PM | Permalink

    Another workaround that solves this issue is html-redirect.

    I needed to create a CD with Flash movie, which contained external url-s.
    In my FLA file, i directed all links to a local html file, that uses redirect command.