Return to Snippet

Revision: 10273
at December 15, 2008 12:24 by starpause


Updated Code
public function getDomain():String
{
	var uri:String = this.loaderInfo.loaderURL;
	uri = uri.substring(uri.indexOf("//")+2, uri.length);
	uri = uri.substring(0, uri.indexOf("/"));
	var urp:String = this.loaderInfo.loaderURL;
	urp = urp.substring(0, urp.indexOf("//")+2);
	uri = urp + uri;
	return uri;
}

Revision: 10272
at December 15, 2008 12:18 by starpause


Initial Code
public function getDomain():String
  		{
			//uri and urp(rotocol) are combined to provide the working domain.
			var uri:String = this.loaderInfo.loaderURL;
			uri = uri.substring(uri.indexOf("//")+2, uri.length);
			uri = uri.substring(0, uri.indexOf("/"));
			var urp:String = this.loaderInfo.loaderURL;
			urp = urp.substring(0, urp.indexOf("//")+2);
			uri = urp + uri;
			trace('DOMAIN! '+uri);
			return uri;
  		}

Initial URL

                                

Initial Description

                                

Initial Title
return the domain (including protocol)  from the loaderURL, no trailing slash

Initial Tags

                                

Initial Language
ActionScript 3