In as2 you would use:
Now in as3 you will have to use loadInfo:
If you know there is a .com in the domain name, just do a split on the info using “.com”. Now the third item in that array (index 2) should be your domain name.
var swfDomain = loaderInfo.url;
var pathArray = swfDomain.split(“.com”);
trace(pathArray); // should be yourdomain.com if on a web server