2011-06-09

AS3 Array size hole



Nhiều khi code ra cái lỗi không thể nghĩ đến, may mà search ra (smartfoxserver2 forum)

The length property does not really return the size of the array, but return the highest index available.

var a:Array = []
a[1000] = "Hello"
trace(a.length)

It will return a lenght of 1001, which is clearly not the size of the Array.