我試圖從時間線中獲得動態影片剪輯。AS3時間線變量問題
我有一個未知長度的時間軸,其中一個關鍵幀(本例中假設爲88)上帶有實例名稱爲「blah」的影片剪輯。
無論我做什麼,我都無法獲得對上述影片剪輯的參考。
這裏是我的嘗試:如何通過代碼導入時間表生成的對象
trace(blah); // null
trace(this.blah); // null
trace(getChildByName("blah")); // null
if(currentFrame == 88)
trace(getChildByName("blah")); // null
for(var i:int=0; i<numChildren; ++i)
trace(getChildAt(i));
/* Returns:
* [object MovieClip]
* [object Shape]
* null
* [object TextField]
*/
// Assuming the first movie clip is the correct one
trace(getChildAt(0).name); // instance?? where ?? are random digits, I'm expecting "blah"
可有人請闡明?
哦,謝謝! 我從來不知道那件事。 – LiraNuna 2008-12-20 23:48:14