views:

466

answers:

2

My problem: I have a program in Flex3 that accesses a server. The program itself is on a server and accessed through a web browser. The point is that I don't want to hardcode in the swf file the IP of the server to access, since it changes and for various other reasons...

How can I do that? Can I put a file in the same directory and what then?

+1  A: 

See this article: Externalizing Service Configuration using BlazeDS and LCDS

It will also work for HTTPService with some minor modifications.

James Ward
+1  A: 

To access a config file on the same server as the SWF, you should be able to use an HTTPService or URLLoader with a relative URL rather than absolute. You can get fancier (changing ports) by accessing the url field of your base Application and creating a new absolute URL from that.

If the SWF is hosted separately from the HTML, you can use BrowserManager url to build your config url instead.

Michael Brewer-Davis