eg: http://localhost:8080

function getHomeURL():String
{
var homeURL:String;
var port:String = ExternalInterface.call('window.location.port.toString');
var hostname:String = ExternalInterface.call('window.location.hostname.toString');

if(port && port!="")
{
port = ":" + port;
}
try
{
homeURL = ExternalInterface.call('window.location.protocol.toString') + "//" + hostname + port;
}
catch(Er:Error)
{
homeURL = "error";
}

return homeURL;
}