user560571
user560571

Reputation: 2047

arraylist in flash action script 3

Is it possible to use an arraylist in action script 3? I want to perform simple operations such as add() and remove()?

Thanks

Upvotes: 2

Views: 7560

Answers (2)

Frazzler
Frazzler

Reputation: 1

I gues somebody down voted the above answer because it's ambiguous. You can't push and pop to an ArrayList.

You need to addItem and getItemAt

Upvotes: 0

sharpper
sharpper

Reputation: 3005

The default array primitive in AS3 is already an array list. You can use commands such as .push(object) and .pop() to add and remove to an array without defining its initial length.

Check out the Array reference here: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Array.html

If you want to use something similar to remove, use: myArray.splice(myArray.indexOf(object), 1);

Upvotes: 10

Related Questions