Posted By

LeeProbert on 04/07/10


Tagged

loaderInfo


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

mediapoint
socialflasher


Detecting if your SWF is running over HTTP or locally


 / Published in: ActionScript 3
 

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.

  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  

You need to login to post a comment.