开发者

Flex: Forcing an array to contain only a specific class?

开发者 https://www.devze.com 2022-12-16 08:41 出处:网络
I\'m trying to create a class that contains an array. However i want to require that the items in the array are themselves of a specific class. Im told there is some sort of tag you can add to do this

I'm trying to create a class that contains an array. However i want to require that the items in the array are themselves of a specific class. Im told there is some sort of tag you can add to do this, but for the life of me i cannot find what it is.

What i hope for is something like:

public class myClass{
    public var foo:String;

    [ArrayType(class="BarClass")]
    public va开发者_JS百科r barArr:Array 
}

Cheers


what's wrong with a Vector ?

var barArr:Vector.<BarClass> = new Vector.<BarClass>();
0

精彩评论

暂无评论...
验证码 换一张
取 消