Why would an XMLListCollection get corrupted by addItamAt function in Flash Builder 4.6 -
the xmllistcollection in question called studentsall , looks after beingness created...
<details> <name>baughman, john d (@hawaii.rr.com @ pearl city h. s.)</name> <id>2693</id> <emailpw>johnbdh@hawaii.rr.com</emailpw> <pw/> </details> <details> <name>benoit, sandra (@gmail.com @ pearl city h. s.)</name> <id>2694</id> <emailpw>sandra@gmail.com</emailpw> <pw/> </details>
i runniing...
studentslist = new xmllistcollection; studentsids = new xmllistcollection; (var _index:int=0; _index < studentsall.length; _index++) { studentslist.additemat(studentsall[_index].name, studentslist.length); studentsids.additemat(studentsall[_index].id, studentsids.length); }
wehn finishes xmllistcollection studentsall looks this...
<details> <name>baughman, john d (@hawaii.rr.com @ pearl city h. s.)</name> <name>benoit, sandra (@gmail.com @ pearl city h. s.)</name> <id>2693</id> <id>2694</id> <emailpw>johnbdh@hawaii.rr.com</emailpw> <pw/> </details> <details> <name>benoit, sandra (@gmail.com @ pearl city h. s.)</name> <id>2694</id> <emailpw>sandra@gmail.com</emailpw> <pw/> </details>
notice how tags in sec index have been duplicated in first.
is bug?
thanks,
john
imho caused sdk bug: https://issues.apache.org/jira/browse/flex-33913
a pretty nasty bug; personally, don't trust xmllistcollection @ all.
workarounds: utilize xmllist, array or arraycollection instead of xmllistcollection or run for
loop on cloned collection - utilize .copy()
flash-builder
No comments:
Post a Comment