GetURL and javascript
January 30th, 2007
This is kind of an old problem, but just in case anyone runs into it. If you are trying to call getURL and javascript commands from an html on your local computer, then it won’t work unless you add the parameter=allowscriptaccess and value=always.
Testing in the browser gives you no feedback at all, and it just doesn’t work. But if you use the Firefox extension: Flash Tracer, then you get this message:
*** Security Sandbox Violation ***

Here are the livedocs with all the parameters you can use.
Entry Filed under: Flash
Del.icio.us
Technorati
6 Comments Add your own
1. Yin&hellip | 2007-06-09 at 4.57 am
where do you add the parameter=allowscriptacess and value=always?
I currently have but the window doesn’t want to open:
on (release) {
stopDrag();
getURL(”Javascript.openNewWindow
‘http://www.macromedia.com’,'MMhome’, ‘width=550′,’height=400′);”);
}
Thanks
2. Danno&hellip | 2007-06-09 at 11.45 am
You add that in the html where you are adding your swf file.
For example:
If you’re using the old way:
<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000″ codebase=”…” width=”550″ height=”400″ id=”right_button” align=”middle”>
<param name=”allowScriptAccess” value=”always” />
<param name=”movie” value=”mymovie.swf” />
<param name=”quality” value=”high” />
<param name=”bgcolor” value=”#ffffff” />
<embed src=”mymovie.swf” menu=”false” quality=”high” bgcolor=”#ffffff” width=”550″ height=”400″ name=”movie” align=”middle” allowScriptAccess=”always” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” />
</object>
Or using swfobject:
var so = new FlashObject(”mymovie.swf”, “movie”, “550″, “400″, “7″, “#ffffff”);
so.addParam(”allowScriptAccess”, “always”);
3. david&hellip | 2007-09-21 at 6.46 am
Man. I wish I would have read this days ago.
Thanks
4. Doug&hellip | 2008-10-16 at 3.29 am
I’m glad I found your article. This was driving me nuts. Strangely for me I was experiencing different results. The getURL(”javascript… function was working locally but not on the server. Adding this parameter resolved the issue for me. Thanks for the tip.
5. nicolas&hellip | 2008-10-21 at 1.52 pm
Great! I was about to pull off my hear. It’s always the same allowScriptAccess thing. Why didn’t I think of this before?
But having a security parameter and having to bypass it everytime to get things to work, definitely defeats the purpose. Ahh, the old problem of flash security…
6. nicolas&hellip | 2008-10-21 at 2.09 pm
one more thing: you must put void(0); after the function call, otherwise the popup will open in a new window but the original window will change to “object: window” (Firefox) or “object” (IE), very annoying. At least when you use the “javascript: window.open” syntax.
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed