Flash 10 Typed arrays

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.

About Carly (Admin)

I'm a multimedia developer based in Brisbane. I work for an elearning firm and code my own projects in the wee small hours between eating, sleeping and working.
This entry was posted in My projects, Programming and tagged , , . Bookmark the permalink.

Leave a Reply