Search code examples
actionscript-3

Actionscript 3 - Type.<T> syntax


Is it possible to use the Type.<T> syntax with user defined classes? For example, let's say I want to create a List class, but I want the user to use it like this:

var myList:List.<String> = new List.<String>;

or is this syntax exclusively evailable to the Vector class only?

Thanks!


Solution

  • Have a look at Haxe ... you can compile Haxe to swfs as well, and unlike AS3, it supports generics ...

    edit: Haxe can target flash10 ... unlike ActionScript 3, Haxe even can use alchemy opcodes: http://haxe.org/api/flash9/memory ... plus the generated bytecode is faster ... actually Haxe is a much better tool to leverage the potentials of the AVM2