PDA

View Full Version : Reading text from file advice


hotelechoyankee
10-12-2007, 01:37 AM
i have a large number of strings (short descriptions of things) that i need to access by a string id and use (one at a time) as the text in a TextArea.

i am new to flex and actionscript so the only thing i could think of was creating an associative array of strings and doing something like:
textArea.text = assocArray["stringID"]

it seems like this is a bad idea creating a huge array (there will be hundreds of strings) when the user may only read a few.

how can i store these in another file (text, xml, i don't care) and then access them using a string id?

is this possible? any help would be appreciated

drkstr
10-23-2007, 06:14 AM
You can use the URLLoader class to load text content from an external file on the server. There are examples of how to use a URLLoader in the docs. Post back if you run into any specific problems after giving it try.

Best Regards,
...aaron