/ Published in: ActionScript 3
Expand |
Embed | Plain Text
var COUNT:int = 10; var a:Array = new Array( COUNT ); //Vector.<Number> = Vector.<Number>( new Array( COUNT )); //a.fixed = true; var writeTo:Object; var i:int; while ( i < COUNT ) { writeTo = a[ i ]; //testing that we indeed have access to the index a[ i ] = Math.random(); writeTo = a[ i++ ]; } while ( i >= 0 ) { a.pop(); //if a is a Vector, this will throw a run-time error i--; }
Comments
Subscribe to comments
You need to login to post a comment.

Thx olwarpaint,
If anyone need to use a fixed length array, consider using Vector class. We have an option to use either fixed or not in Vector.