When you apply the filterfunction, you can check in the debugger also that the collection length would be reduced to the length filtered items.So at a given point say the filtered length is 2 and you try to add at 8 , it is bound to throw the exception.
One way could be to use filterfunction = null before adding the new item, then reapplying the filter function. Or you can try checking the length of the collection before adding the item. Depends on what is the criteria of choosing the index. On Sat, Feb 23, 2008 at 8:00 PM, Pavel Cristian Gabriel <[EMAIL PROTECTED]> wrote: > Hi > > I store my data into a XMLListCollection variable (name XC). The initial > lengt of this XMLListCollection is 10 items (for example: XC.length==10). > I leave the user to filter this data and I added a filterfunction to this > variable. I set another function named sync() that run every 10 seconds (for > example). This function is trying to insert an element into > XC:XMLListCollection at a specific position (for example 8 > XC.additemat(item,8)). > After the user filter the data, the length is 2 and when the sync() function > is activated, this function call "addItemAt(item,8)" and I receive "Index > out of Bound...". > I know how to read the entire list (XMLList) using the .source properties > but I don't know how to insert an element at a specific position (for > example 8). > > Please help me (if you know) > Thanks in advance > Cristy > >

