royale-asjs icon indicating copy to clipboard operation
royale-asjs copied to clipboard

ArrayList.addItemAt() behaves like ArrayList.setItemAt()

Open paul-uulabs opened this issue 5 years ago • 3 comments

In my working with ArrayLists I've found that addItemAt is not inserting a value, it is setting a value...

So:

var tableData:ArrayList = new ArrayList();
for( var x:int=0; x<100; x++) {
   tableData.addItemAt( value[x], 0 );
}

Will produce an ArrayList of only 1 item at position 0...(presuming value is an array 100 length).

paul-uulabs avatar Dec 07 '20 19:12 paul-uulabs

Hi, are you using org.apache.royale.collections.ArrayList or mx.collections.ArrayList?

carlosrovira avatar Dec 08 '20 12:12 carlosrovira

I tested for org.apache.royale.collections.ArrayList and all seems to work fine. Maybe the issue is on mx version

carlosrovira avatar Dec 08 '20 12:12 carlosrovira

The code for the mx version is identical AFAICT.

@paul-uulabs Please attach a full test case.

Harbs avatar Dec 08 '20 12:12 Harbs