/ Published in: ActionScript

How to restrict swf to a specific url
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
isStolen = 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("thevirtualdesign.com")) { getURL("http://thevirtualdesign.com/"); return; } else { delete (isStolen); }//End if
URL: http://webxadmin.free.fr/article/how-to-restrict-swf-to-specific-url-458.php
Comments
