Flash 10 beta was released on Thursday. The lovely wonderful developers of flashdevelop have done the hard work of connecting up the compiler and autocompletion to allow you to easily play with the nightly build of the sdk and still be able to work on normal projects.
Anyway Typed Arrays are a feature I have been looking forward to since the rumours came out from the ecma specification on it.
To define an array:
private var myTypedArray:Vector.<String>;
To set the variable
myTypedArray = new Vector.<String>;
Then to add and retrieve values are the same for any other array.
myTypedArray[0] = ("Hello World"); myTypedArray[1] = (42); //will generate a compile error
I have discovered a bug, which I’ll work out where to report later
myTypedArray.push(42);
The above should generate a compile error but it doesn’t. When retrieving the value, it calls the toString on the object. I also tested with an Object value.