Home » unshift

Vector.unshift bug已修复

2009年8月7日 1 条评论
package  
{
    import flash.display.Sprite;
    import flash.system.Capabilities;

    /**
     * www.litefeel.com
     * lite3@qq.com
     * @author lite3
     */
    public class VectorTest extends Sprite
    {

        private var list:Vector.<MyClass> = new Vector.<MyClass>();

        public function VectorTest() 
        {
            trace(Capabilities.version);
            var n:int = 3;
            while (n--)
            {
                //list.length++;
                list.unshift(new MyClass());
                trace(list);
            }
        }

    }

}
class MyClass{}

输出:

WIN 10,0,22,87
[object MyClass]
[object MyClass],[object MyClass]
[object MyClass],[object MyClass],[object MyClass]
标签: , , ,
回到顶部