debug snippet to check whether the client is local or online
AS3 September 26th, 2008often you need different settings whether you are working within your IDE environment during development, or when the swf is actually put LIVE. I have tried many variants of passing DEBUG=true or similar, but found that this one is the most elegant one:
Actionscript:
-
//checking whther client is online or within IDE
-
if(stage.loaderInfo.url.indexOf("file:") != -1){
-
trace("Lokal");
-
_debug = true;
-
}else {
-
trace("Server");
-
_debug = false;
-
}