Ok, I had no idea you were supposed to do this. Or maybe I came through the backdoor and read the instructions in the wrong order. At any rate, it seems that DataProvider (mx.controls.listclasses.DataProvider) has a method called addItemAt. If you try to add an item to an index that is greater than the array’s length, it won’t add the value. Now, Flash will do this just fine for you. If you have an array that is empty:
cow = ;
And you decide to add something to position 10, you can:
cow = "moo";
What’s jacked, is DataProvider won’t. So… I guess the trend now is to dimensionalize your array’s length so that method will work properly?
mx.controls.listclasses.DataProvider.Initialize(Array); cow = ; cow.addItemAt(9, "moo"); // Cannot add an item past the end of the DataProvider trace(cow); // undefined cow.length = 10; cow.addItemAt(9, "moo"); trace(cow); // moo
It works when I do some tests here… it just seems so… VB’ish.