This content has been marked as final. Show 7 replies
Don't do it. You're copying data that shouldn't need to be copied. Try to make your components access data directly from the xml.
How would I do that, exactly, and why isn't this way ok? Seems to work fine...
You already have it in the form you need. XMLList is a fine collection mechanism that provides iteration. No reason to iterate through it populating an Array and then having your component access it's data through the Array class.
Make your component so it accesses the XMLList instead.
That is if you don't require some feature in the Array class.
You misunderstand I am not trying to put it in an array at all. I am using it as xml.
What I am doing is creating an XMLListCollection out of each "step" in my xml, and assigning each of those to a list component on my app.
I am doing each in turn, one for each "step" in my data. I was only asking the question since I manually need to remember how many steps there are, so if I have 7 steps the last one is l6.dataProvider = new XMLListCollection(dp.step.choices.choice).
I am asking for advice on some way to automatically count the length of the XML and generate enough list components to handle the data, no more no less.
This code may help:
Thanks Greg, exactly. Will be a big help in many cases.
Actually, as you want to populate lists, this code may suit your needs better: