title: Getting ASP.NET root path to Flex?
body: <p>I am working on a project that is primarily ASP.NET based. The main project is meant to be deployed to multiple locations for different clients, so one client might be located at website.com/client1 and another at website.com/client2. Within the application, we regularly use the application root operator <code>~</code> to get the path to a resource.</p>
  
  <p>We also have a bunch of Flex applications that get deployed in there, and many rely on web services within the ASP.NET application. What I'm after is a way to reference the services relative to the application root. Here's an example of the location of some files for two client deployments:</p>
  
  <ul>
  <li>Client A
  <ul>
  <li>website.com/clientA/swf/FlexApplication.swf</li>
  <li>website.com/clientA/services/webService.asmx</li>
  </ul></li>
  <li>Client B
  <ul>
  <li>website.com/clientB/swf/FlexApplication.swf</li>
  <li>website.com/clientB/services/webService.asmx</li>
  </ul></li>
  </ul>
  
  <p>FlexApplication and webService are both exactly the same, so what I want to do is something like this in the Flex code:</p>
  
  <pre><code>var myService:CustomService = new CustomService(~/services/webService.asmx);
  myService.callMethod("Test");
  </code></pre>
  
  <p>I would like to avoid using relative paths for the usual reasons. Is there a good way to do this or a good way to pass the root url to the flex application from ASP.NET? Thanks in advance.</p>