Dear all,
I have been dealing with this error for two days. Basically if I have a “for in” loop, that collects all items on stage and put their information in a XML var.
var myRows: XML = <…>// this XML var is initialized with some lines
for (var i:int =0; i<this.numChildren; i++) {
.
myRows.rows.(@id == pointer).appendChild(newNode);
.
}
where myRows is my XML var, (@id == pointer) is a filter to put items in a specific position and newNode is the new node (information of the items) I want to add.
So far everything is fine but when I try to add more than two items in a same cycle of the “for in” I got this error
TypeError: Error #1086: The appendChild method only works on lists containing one item.
For example:
var myRows: XML = <…>// this XML var is initialized with some lines
for (var i:int =0; i<this.numChildren; i++) {
.
myRows.rows.(@id == pointer).appendChild(newNode);
myRows.rows.(@id == pointer + 1).appendChild(newNode);
.
}
or
var myRows: XML = <…>// this XML var is initialized with some lines
for (var i:int =0; i<this.numChildren; i++) {
.
for (var i:int = 0; i<3; i++){
myRows.rows.(@id == pointer +i).appendChild(newNode);
.
}
Do you have any idea what I am doing wrong.
Thanks in advance