getURL() not working

I was taking a look at ThickBox earlier, and having a nose around calling it from Flash. To do this, I needed to call JavaScript from flash.

Although if you’re using Flash 8, you should probably use ExternalInterface, the quickest way to do this is by calling:
[as]
getURL(”javascript:functionName(param1,param2)”)
[/as]

It’s been a while since i’ve needed to to do this, and it just wasn’t working on a simple test. Even simplifying this wouldn’t work in either Firefox or IE:

[as]
getURL(”javascript:alert(’hi’)”)
[/as]

Turns out it works fine when the content is served through a webserver.

Also, after reading one of Mike Chambers posts, I found you can run this locally, if you put this in your object and embed tags:

[html]
allowScriptAccess=”always”
name=”allowScriptAccess” value=”always”
[/html]

Of course, this has other implications, so best not to do this unless you know what you’re doing.

0 Responses to “getURL() not working”


  1. No Comments

Leave a Reply