views:

71

answers:

2

Hi all!

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!

+4  A: 

At the moment it can only be used by the Vector class. Any other attempted use of the syntax will throw a compiler error.

Branden Hall
A: 

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

back2dos
But unfortunately, to my knowledge, the current version of Haxe doesn't compile for Flash Player 10.
Joe Zephyr
...speaking under correction though.
Joe Zephyr