PDA

View Full Version : how do you set the type(:Number, :Boolean, etc) of an Array??



oldmanwinter
July 28th, 2008, 09:05 PM
i know, it's a simple question, but i've been looking around for a good ten minutes and all i can found about arrays is how to make them, via "var arraynamehere:Array=new Array()", and none of them are typed. can you even specify a type for an array? TIA ^^

TheCanadian
July 28th, 2008, 09:09 PM
You can't with the Array class, but you can easily create an Array subclass which is typed. Post if you need help with this.

oldmanwinter
July 28th, 2008, 09:18 PM
that's ok, i was just curious, thanks for the quick response :)

Anogar
July 28th, 2008, 09:44 PM
You will be able to with Flash 10. :)



var myVector:Vector.<int> = new Vector.<int>(4, true);

TheCanadian
July 28th, 2008, 10:31 PM
And Flash 9 :evil:

http://www.kirupa.com/forum/showthread.php?p=2366034#post2366034