I have a flex application which connects to a database. There are several servers on which the databases run. Currently, I have a textboxes ‘host’ and ‘port’ where user can specify to which database they want to connect. I would like to change it to a ComboBox with a list of hosts. I know how to hardcode it in the application, but I would prefer the application to read an xml (or other) file on startup and populate the ComboBox with its contents (in case the databases IPs change in the future). The XML would look somewhat like that:
<root>
<host ip="123.123.123.123" port="1234"/>
<host ip="255.255.255.123" port="2700"/>
<host ip="18.12.65.123" port="1270"/>
</root>
How do I do that? I would like to host the file on server together with the application.
You should load the file from the server (using the
URLLoaderclass)Then you can read the data of the loader.
For example:
And yes, you can use relative urls