Object is not MovieClip object is object what I am trying to do is provide some data to my Flex chart and it depends from user how many data he will provide.So I have a for loop, I want it to work like this.
var obj:Object = {}; for(var i:int = 0; i < _someArray.length; i++){ obj["someProperty" + i] = _someArray[i]; // and so on } // then I want to read those the same way for example for(var i:int = 0; i < _someArray.length; i++){ trace(obj["someProperty" + i]); }this doesnt work for me when I debug the obj is empty it doesnt have any properties or values…
That works perfectly for me. I cut-and-pasted it exactly as it is written (but removing the duplicate definition for “i”) into a new AS3 FLA, added :
var _someArray:Array = ["one", "two" ,"three", "four"];at the top of the code, and it traces :
one
two
three
fourhmm so maybe it traces out but it doesnt actually crate the properties in the object, thats why It doesnt work as data provider…
Now I have no idea what you mean.
How can it not be creating the properties on the object if the second loop tracing the value of those properties, on that object?