Hi, if i do this: DataProvider.Initialize(Array); and var layers = new Array();
it works just fine. Don't know if this is the accepted way to go about it though ;)).
As for as i know i thought DataProvider was some kind of adapter class for arrays not really meant to be instantiated on its own.
greetz Hans At 06:56 PM 11/29/2005, Cortlandt Winters wrote:
Hi Folk, I can't believe I'm having trouble using a dataprovider, but well... I am. If somebody could lend me a brain I would appreciate it. Mine apparently is having some problems. Here is the most reduced case. This code is in the main timeline. import mx.controls.listclasses.DataProvider; var layers = new DataProvider(); layers.addItem({guy:"a"}); var thingtestLength = layers.getItemAt(layers.length); var thingtestItem0 = layers.getItemAt(0); var thingtestItem1 = layers.getItemAt(1); trace(layers.length); // returns "undefined" // but this one which uses layers.length to get the item trace(thingtestLength.guy); // returns "a" // these both just return undefined trace(thingtestItem0.guy); // returns "undefined" trace(thingtestItem1.guy); // returns "undefined" So the item is being filed with an "undefined" key. I thought that maybe we needed to have a label and tried this as well, but with the same results. layers.addItem({label:"joe", guy:"g", data:"a"}); and layers.addItem({label:"joe2", data:{thing:"a2"}}); with the same results Does this make sense to anyone? By the way I also tried var thingtestLength = layers.getItemAt(layers.length-1); as that is what is supposed to be the proper syntax, but that gets us "undefined" as well. And of course I tried getLength() as well and I tried using DataProviderClass as well in desperation. I also tried "dataProvider" with a lower case d as that shows up syntax highlighted but then the compiler says it cant find the file. It's been years since I've been this bewildered with something not working. I even uninstalled and reinstalled flash thinking that my configuration must be broken, but no. It seems to be me. Thanks for any thoughts. -Cort _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders