Posted By

starpause on 12/15/08


Tagged

info domain loader loaderInfo


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

THEPWN3R


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


 / Published in: ActionScript 3
 

  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  

You need to login to post a comment.