PDA

View Full Version : [AS3] Array typing


LivestockTony
08-02-2008, 09:03 PM
When using an array, and using numbers to seed it, ie:


MyArray.push(1);


Does flash know (or care) if that 1 down the road is going to be used as an int or a Number?

Thx,
-Tony

senocular
08-02-2008, 11:57 PM
in the context of the values stored in the array, no. All array values are untyped, and there is no real way to change that. Flash Player 10 will, however, come out with a new Vector structure which is pretty much just like an Array except it actually types the values inside. Vectors (typed arrays) are defined with one content type that requires that all values added be of that type.

LivestockTony
08-03-2008, 12:50 AM
Thanks, that helps. I'm glad I found this forum.

-TF