[MX04] Figure out how to make this code work in my flash 7 files.
//this is a code to ensure flash is only played on my server as a security measure. I would like to use it but I am not able to really implement this for my flash. Would like a consultant.
PHP Code:
sStolen = function(ourDomainName){
var protocol, urlString, part1, part2, part3, part4, domain;
//Get the current url
urlString = _root._url;
protocol = urlString.substr(0, urlString.indexOf(":"));
//if we are on the internet.. do the check
if (protocol == "http") {
/*get everything between the "://"
and the next "/"*/
part1=urlString.indexOf("://")+3;
part2=urlString.indexOf("/", part1);
domain=urlString.substring(part1,part2);
//throw away any prefixes of "."
part3=domain.lastIndexOf(".")-1;
part4=domain.lastIndexOf(".", part3)+1;
domain=domain.substring(part4, domain.length);
//Do the right thing!
if(domain != ourDomainName){
return(true);
}//End if
}//End if
}//End function
//Do a check for theives..send them to your page
if (isStolen("yourDomain.com")) {
getUrl("****off.htm");
return;
} else {
delete(isStolen);
}//End if