[note to self]
Recently been doing some performance-intensive development for the as3isolib.v2.core engine and was experimenting with what I thought were fixed-length arrays. Apparently they don’t exist in as3. I discovered this as I had inadvertently called pop() on a fixed-length array. You’d expect this would throw a run-time error but since it doesn’t and thus I had a hard time determining the origin of other run-time errors.
To prove this you can simply run the following test: pastebin link (sorry the code formatting for multi line code isn’t working at the moment).
In order to ensure an collection is indeed a fixed-length and throws run-time errors if you attempt to modify the length, you need to use a Vector and set the fixed property to true;
var v:Vector.<T> = Vector.<T>( new Array( FIXED )); v.fixed = true;
On another note: I did conclude that during my performance-intensive code, that using fixed-length collections made nominal improvements. This is further reduced when NOT using simple object types of String, Number, int, or uint in a Vector. In my case I was storing complex data structures in a FILO queue.