Home > flash > 【FLASH】AS2.0 ARRAY tips

【FLASH】AS2.0 ARRAY tips

  • 2008年10月27日 11:32
  • flash

バグかなんだか知らないけど、
あんまり認知されてないArray.lengthの返り血の違い。メモ

--------------------------------------------------

var arr:Array = new Array (100);

var num:Number = arr.length;

trace(num);
//これ100が返ってきます。

--------------------------------------------------
以下、回避方法
--------------------------------------------------

var arr:Array = [100];

var num:Number = arr.length;


trace(num);
//これ1が返ってきます。

--------------------------------------------------

var arr:Array = [];

arr.push(100);

var num:Number = arr.length;

trace(num);
//これ1が返ってきます。
--------------------------------------------------


ヨロシク!

Comments:2

Comment Form
Zellcorp 2010年3月10日 20:26

You have really great taste on catch article titles, even when you are not interested in this topic you push to read it

Funtoosh 2010年3月13日 16:55

You have to express more your opinion to attract more readers, because just a video or plain text without any personal approach is not that valuable. But it is just form my point of view

Trackbacks:0

TrackBack URL for this entry
http://tag.4digit.jp/blog_admin/mt-tb.cgi/29
Listed below are links to weblogs that reference
【FLASH】AS2.0 ARRAY tips from taglog

Home > flash > 【FLASH】AS2.0 ARRAY tips

Search
Feeds

Return to page top