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


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public function getDomain():String
  2. {
  3. var uri:String = this.loaderInfo.loaderURL;
  4. uri = uri.substring(uri.indexOf("//")+2, uri.length);
  5. uri = uri.substring(0, uri.indexOf("/"));
  6. var urp:String = this.loaderInfo.loaderURL;
  7. urp = urp.substring(0, urp.indexOf("//")+2);
  8. uri = urp + uri;
  9. return uri;
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.