Return to Snippet

Revision: 9564
at November 12, 2008 12:21 by chrisaiv


Initial Code
//In this case, the Vector will only hold a DataType of <uint>
var numbers:Vector.<uint> = new Vector.<uint>(3, false);
numbers[0] = 1;
numbers[2] = 2;
numbers[3] = 3;

trace( numbers )

Initial URL

                                

Initial Description
This feature which is available in Flash CS4 is a much more efficient Array.  Unlike Array, you cannot place data in any given index. Each index must have a value.  For example, you can't have data in Array[0] and Array[5] but nothing in between. The second parameter is a Boolean and it decides whether the Vector array can have more indexes added later.

Initial Title
AS3: Optimized Arrays (AKA Vector)

Initial Tags

                                

Initial Language
ActionScript 3