Arrays are a pretty basic data type… there should be tons of info about them if you Google it. The thing that you’re looking for is actually a method of the String class,
String.split()
Say you have a bunch of data in your file. It could look like this:
data 1_data 2_data 3_fred_taco_1234_abcd
Whatever the data is, the important part is to separate each piece of the data with an underscore. Then, when you load that data into a string inside Flash, you can use the split function to create an array. Here’s what that code would look like:
var myArray:Array = myString.split(“_”);
Ok, now you have split all the little substrings (pieces of data) into an array. Now you can access the data like Kalinium was saying above. For example:
trace(myArray );
will trace the value
fred
to the output window.
Hope that helps :)
|