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


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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.