0
我想創建2d數組,但是我得到錯誤。這裏是我的代碼:如何動態創建二維數組?
var cleanArr:Array = new Array();
for (var i:int = 0; i < arr.length; i++)
{
cleanArr[i][0] = arr[i].substring(0, 29);
cleanArr[i][1] = arr[i].substring(29, int.MAX_VALUE);
trace(cleanArr[i]);
}
我得到這個錯誤:
TypeError: Error #1010: A term is undefined and has no properties.
at SubtitleLoader/onComplete()[C:\Users\ ... \SubtitleLoader.as:88]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
線88:cleanArr [I] [0] =改編[I] .substring(0,29);
我該如何解決這個問題?
謝謝你的回答。這工作正常。 – nikel