That would cause more problems. If you use arrays to keep track of objects, especially when using multi-dimensional arrays, you would no longer have the ability to see if an object has been set for a particular cell. Example...
say that I want to get a bitmap from my array that has an index of 16. I would normally retrieve with something like this...
so the function above would either return the BitmapData that's stored in myArray[n] or load and return a new bitmap. With the index-wrapping feature, that would no longer be the case.Code:function getBitmap(n:uint):BitmapData { return myArray[n] ||= bitmapLoader(n); } var bmp:BitmapData = getBitmap(16);
--- edit ---
though, that's not to say that the function itself wouldn't be useful. Just, as a static function either in Math or Array, and not implemented as a default.




Reply With Quote
