Where should I store data about the server in a Flex app? -


I am a flex newbie and I am developing a flex application that needs to talk to the AMF server so that it The user can be certified.

Where should I store the server URL? I do not want to hardcode it into the source code, but the URL should be fixed when compiling time, because when I compile the app it should be tied to a specific server.

If you need a URL on time compilation but you do not want to "hardcode" it, then The best part is to store it. They work on C / C ++ as #IFDEF or #define and you can change the URL without changing the application (just re-compiling it) .

You must add something like this to your compiler options:

  -define + = APP :: amfServerUrl, 'http: // localhost / some / path /'   

And then, on your app code:

  Private static conform AMF_SERVER_URL: string = APP: amfServerUrl;    

Comments