I would like the swf file to stop (or any other action) if it is not playing in a specified URL. This obviously requires a conditional statement. I'm able to accomplish this in a local environment by checking current location. But I don't want the movie to stop if it is already in the desired location, in this case the specified URL. Will the movie play if the current location is equal to the speficied URL? How do I define the URL, absolute or relative path? I'm pretty new to scripting, would appreciate any help. Thanks.

So you are trying to stop people from running your SWF off your server? There are several ways to check the domain of the current page to make sure it is on your server (or for anything else you might need it for)

In AS2, or AS3 Flash:

var lc:LocalConnection = new LocalConnection();

var myIP:String = lc.domain;

AS3 Flex:

on creation complete event handler:

private function doInit():void {

var myIP:String = this.loaderInfo.

}

Then it is a simple if statement to check that domain. Remember, this is the domain of the URL, so: "www.myWebsite.com" or "myWebsite.com" or "subdomain.myWebsite.com"

For example, in an app I wrote there is one subdomain that always uses https, and all others use http, so:

There seems to be no scripting error. However I get an "undefined" value when tracing either myIP or my_lc. The condition will not work unless these values are the proper strings. Is the code actually more complicated than this? What am I missing?