This content has been marked as final. Show 9 replies
Is this what you're trying to do?
This is exactly what I need to do. How do I make myCollection?
myCollection is most likely going to be an ArrayCollection. You simply create a new ArrayCollection, then add each Object to the collection - likely being returned from some WebService or RemoteObject. See attached code....
Hope this helps...
Thanks for your advice Eric. I' having nothing but trouble with this script. After several failed attempts to implement the code you sent me I've tried to simplify it to this:
private var myCollection:ArrayCollection = new ArrayCollection();
private var car:Object = new Object();
car.photo = String("cc");
car.name = String("ddd");
I think this should work, but I keep getting the error:
1120: Access of undefined property car.
What am I doing wrong??
I think I've fixed it. Not quite sure how but it seems to be working now. Thanks for all your help.
Ok. Good. Is that all of your code? I fyou could attach the entire content of your <mx:Script> tags, I could probably debug it a little easier for you.
I've got it working and now I'm into the PHP end of the work and that's much more familiar territory. Thanks a lot.
FYI, you cannot do complex assignments in the instance scope area of an application/component, you must do it in a function.
If the code you posted was really where it looks like, this is the problem.
Thanks Tracy, that's good to know. I had taken it out of the function in an attempt to simplify the problem, but I put it back in. Maybe that was my problem.