Wednesday, July 14, 2010

Testing local or online

AS3
if(stage.loaderInfo.url.indexOf("file:"!= -1)
{
    trace("Local");
}else{
    trace("Server");
}

AS2
if(_url.indexOf("file"!= -1){ 
    trace("Local");
}else{
    trace("Server");
}


From Snipplr

No comments: