Just wanted to share this "as" for getting the host. It can be a little pain when working between running local, inside flex, or on a server. So if your using services this may or may not benefit you.

I use it in my main application container. Us it however you wish. If anyone has a better way to do this then please share.

If in your main app the you can get at it vie Applicatio.application.g_HostString. Also ready to bind.

  [Bindable]
  [Inspectable]
  public var g_HostString:String;
  
  private function initComponent(){
   //parse the host url into a usable value for services etc...
   var baseurl:String =Application.application.url;
   var pattern1:RegExp = new RegExp("http://[^/]*/");
   if (pattern1.test(baseurl) ==true){
    g_HostString = pattern1.exec(baseurl).toString();
   }
   else{
    g_HostString = "http://localhost/"
   }   
  }

Jason

 



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to