ajwei810192
02-10-2009, 05:55 PM
Hi,
I have been digging around the problem of how to get my CollectionEvent to work, and I seem to be able to see the problem, but I am not sure how to get it to work properly.
In my actionscript, it seems to only tell that event.items.length is 1, while I am calling my array collection from the HTTPService, and I have tested the length of my Array Collection, which seems to be accurate. What I tried to do is to use that number in the CollectionEvent function, but that does not work at all.
Can anyone please help me out?
Thanks in advance.
Alice
Attach Code
private function onChange(event:CollectionEvent):void{
for (var i:int=0; i< event.items.length; i++) {
Alert.show(event.items.length.toString()); //This always gives me 1 when I have 12 items
var obj:Object= event.items[i].source;
for (var p:String in obj) {
if (p !- "mx_internal_uid") {
cellInfo.text += "\n";
if (event.items[i].property ==p) {
cellInfo.text+="*"}
cellInfo.text += p += " + obj[p]; //This is only displayed on the first 2 items no matter what I clicked
}
}
}
}
}
I have been digging around the problem of how to get my CollectionEvent to work, and I seem to be able to see the problem, but I am not sure how to get it to work properly.
In my actionscript, it seems to only tell that event.items.length is 1, while I am calling my array collection from the HTTPService, and I have tested the length of my Array Collection, which seems to be accurate. What I tried to do is to use that number in the CollectionEvent function, but that does not work at all.
Can anyone please help me out?
Thanks in advance.
Alice
Attach Code
private function onChange(event:CollectionEvent):void{
for (var i:int=0; i< event.items.length; i++) {
Alert.show(event.items.length.toString()); //This always gives me 1 when I have 12 items
var obj:Object= event.items[i].source;
for (var p:String in obj) {
if (p !- "mx_internal_uid") {
cellInfo.text += "\n";
if (event.items[i].property ==p) {
cellInfo.text+="*"}
cellInfo.text += p += " + obj[p]; //This is only displayed on the first 2 items no matter what I clicked
}
}
}
}
}