0 Replies Latest reply on May 16, 2008 7:45 AM by brad carvey-kplRXI

    HTTPService URL

    brad carvey-kplRXI
      I am working on my first Flex and CF Project. The project works when I run it locally and on a remote CF server. The problem I have is with coding.

      I currently have variables defined for running locally and for running on the server. I am using comments to manually change which variables will be used for local and which ones to use for deploying to a remote server.

      For example,
      the server needs a full path (d:\home\name\wwwroot\...)
      locally I use (c:\coldfusion8\wwwroot\...).

      Local code uses the local CF server
      <mx:HTTPService id="getDataFile"
      url=" http://localhost:8500/com/xml/movieData.xml"
      resultFormat= "object"
      result="onResult(event)">
      </mx:HTTPService>

      remote code uses the full url
      <mx:HTTPService id="getDataFile"
      url=" http://www.somesite.com/com/xml/movieData.xml"
      resultFormat= "object"
      result="onResult(event)">
      </mx:HTTPService>

      I was thinking I should have the code detect if its running locally or remotely and then select the appropriate variables for remote or local operation. I would appreciate some feedback on the best way to make this work.

      BTW, I don't like conditional compiles to solve this.

      Brad Carvey