/ Published in: ActionScript 3
Method finds out if application runs online or offline and fills the variable contentURL with a flashvars parameter.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private function applicationIsOnline(stage : Object) : Boolean { var returnVal : Boolean = new Boolean(false); if(stage.loaderInfo.url.indexOf("file:") != -1) { trace("Computer works lokal"); contentURL= ""; returnVal = false; } else { trace("Computer works online"); if(stage.loaderInfo.parameters.contentURL != null) { contentURL = stage.loaderInfo.parameters.serverURL; } else { contentURL = ""; } returnVal = true; } return returnVal; }