Return to Snippet

Revision: 25024
at March 18, 2010 04:28 by shabbar


Initial Code
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

Initial URL
http://webxadmin.free.fr/article/how-to-restrict-swf-to-specific-url-458.php

Initial Description
How to restrict swf to a specific url

Initial Title
How to restrict swf to a specific url

Initial Tags

                                

Initial Language
ActionScript