-
-
[求助]flash的问题(as3)
-
发表于:
2016-9-30 12:10
3028
-
具体如下:
//声明一个包含100个对象的 vector
this.s = new Vector.<Object>(100);
//初始化这100个vector,每个vector的大小为4096字节,其中 (1022*4)字节为内容(1022个元素),8字节为头部(4字节为size,size=1022)
var tt:* = 0;
while (tt < 100)
{
this.s[tt] = new Vector.<uint>(1022);
this.s[tt][0] = 0x55667788;
this.s[tt][(0x3fe-1)] = 0x25252525;
tt++;
};
//手工将第51个对象的size改为1023
(this.s[50] as Vector.<uint>).length = 1023;
//第一种查找方法
t1 = 0;
while (t1 < 100)
{
try
{
if ((this.s[t1] as Vector.<uint>).length > 1022)
break;
}
catch(e:Error)
{
};
t1 = (t1 + 1);
};
//第二种查找方法
t2 = 0;
while (t2 < 100)
{
if ((this.s[t2] as Vector.<uint>).length > 1022)
break;
t2 = (t2 + 1);
};
问题:
t1为多少(50还是51)?
t2为多少(50还是51)?
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课