Detecting if your SWF is running over HTTP or locally


/ Published in: ActionScript 3
Save to your folder(s)

In Flex the Application needs to be complete so run this code within your applicationComplete event handler and pass a Boolean into a Data model somewhere so you can use it elsewhere.


Copy this code and paste it in your HTML
  1. /*
  2. In Flex the Application needs to be complete so run this code within your applicationComplete event handler and pass a Boolean into a Data model somewhere so you can use it elsewhere.
  3. */
  4.  
  5. var isLocal:Boolean = loaderInfo.url.indexOf("file") == 0;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.