Typed Arrays?

Here’s a new thing I just discovered, the Vector class! Not what you’d think by the name. If you’re me your thinking that it must have something to do with the Drawing API.

Turns out a Vector is best described as an Array where all of the elements are of the Same type. Apparently these are a little more efficient than Arrays for this reason. When you think about this is what I’m doing most of the time.

Use a Vector in this way:

var v:Vector.<String>;
v = new Vector.<String>();

The lines above create a new Vector v and type it to String. This example was taken from the Flash Help on the Adobe site.


Looks like this only works in the Flash 10 Player.

Leave a Reply

Your email address will not be published. Required fields are marked *