views:

105

answers:

2

Google has indexed my .swf file, so it’s loading by itself in a browser ( example.com/FL_map_page.swf )

I need for the .swf to check to see if it is loaded on the .html page and if not switch to the correct page.

A: 

You mean someone is hot linking your swf file or it's just being loaded without the page? You could create a bridge with javascript so that the swf doesn't execute unless you load the javascript from the page. You could also avoid using javascript and use flashvars generated by your web site's backend (PHP or whatever) to make this check. You can attempt to redirect the browser to the page and simnply show the URL to the page where it is supposed to be viewed in case the redirect fails.

apphacker
A: 

Check the page url with ActionScript;

import flash.external.*;
var url;

function getURL() {
    url = ExternalInterface.call("window.location.href.toString");
}
cartman
But then he has to hard code the URL in the app. And if he ever changes the URL scheme on his site he'll have to fix his flash app(s).
apphacker
Well you could also make sure its played over the network, there is no silver bullet here.
cartman