PDA

View Full Version : getting url for an HTTPservice from a file


sbeausol
03-12-2009, 06:43 PM
Hello-

I have a flex/actionscript application i am developing in where I harvest data from a url using php stream XML. I would like to store the url for my HTTPservice in a text file rather than hard coding it. At runtime, I would open the file, read its contents which would be something like this:

url=someurl/path/to/phpfile

Then I could set my HTTPservice to whatever the text file contains. I've looked at this example on using the URLLoader http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLLoader.html however I'm finding that when I need the url it is null and doesn't load until after the httpservice has fired.

Any thoughts on how I can set the url for httpservice from a text file?

Sekhar
03-12-2009, 08:47 PM
Could you post your code? My guess is you're trying to access the file contents before it's finished loading. If you're using URLLoader, listen for the Event.COMPLETE event before checking the contents.