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


You need to login to view comments.