Find the domain your flash file is currently on. [AS3]

A project I was working on required that certain domains had different output than others. Regular expressions worked somewhat but I couldn't figure out how to make it less specific so I didn't have to worry about subdomains. I decided using split was best to get down to the exact portion of the url being returned.
//find current site
getLocation(this.loaderInfo.url);

function getLocation(urlStr){
  	var found:Object = urlStr.split(".");
   if(found){
	   for(var j=0;j<found.length;j++){
		   var currStr=found[j].split("/");
		   //find the domain ... if you need to use .uk or .jp this will need to be modified.
		   if(currStr[0]== "com" || currStr[0]== "org" || currStr[0]== "net" || currStr[0]== "am" || currStr[0]== "ca"){
			   var urlCount=j;
			   var currDomain= found[urlCount-1].replace("http://", "")
			   break;
		   }
	   }
	   //compare current domain to your list of domains
		for(i=0;i<siteKeys.length;i++){
			if(domainList[i]==(currDomain+"."+currStr[0])){
			 	currKey=domainList[i];
				break;
			}
		}
   }
   // if domain not found default to this
   if(currKey==""){
	  //do something
   }else{
	   //do something
   }
}