,如果我想返回/检查类值有什么办法可以模仿我们在AS3顶级类例如相同的行为:的ActionScript 3 - 申报
var myArray:Array = [1,2,3,4];
trace(myArray) // [1,2,3,4];
正如你可以看到它在追踪时返回自己的对象。
但如果我创造我自己的类,extends Array
我得到
var queue:Queue = new Queue([1,2,3,4]);
trace(queue) // no output
所以这里有2个问题。
是有可能创建一个自定义的类的实例,就像我喜欢创建一个数组:
var queue:Queue = [1,2,3,4];
//instead
var queue:Queue = new Queue([1,2,3,4]);
,我怎么能要求对象时返回的超级对象等;
trace(queue) // [1,2,3,4];
我不知道这是否可能在AS3做
感谢您的帮助
相关:http://stackoverflow.com/questions/3090406/extending-array-in-actionscript-3-flex – 2010-07-26 20:02:21
非常感谢杰米[Quasimondo回答](http://stackoverflow.com/questions/3090406/extending-array-in-actionscript-3-flex/3092347#3092347)真的是我一直在寻找:) – zanona 2010-07-26 22:12:04