Posted By

LeeProbert on 04/07/10


Tagged

FlexGlobalstopLevelApplicationflex 3flex 4loaderInfo


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

socialflasher
mediapoint


Get the server/domain name that your SWF is running on


 / 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 Flex3Application:String = URLUtil.getServerName(Application.application.loaderInfo.url);
  6.  
  7. var Flex4Application:String = URLUtil.getServerName(FlexGlobals.topLevelApplication.loaderInfo.url);

Report this snippet  

You need to login to post a comment.