我有一個空的movieclip容器,我在其中添加了作爲兒童的動畫片段。但是,當我試圖讓孩子們不追蹤/返回任何東西。這是我的代碼。Flash Movieclips兒童迷失
// Creating Container
var competencyContainer:MovieClip = new MovieClip();
competencyContainer.name = "competencyContainer";
this.addChild(competencyContainer);
var lastx:Number = 200;
function createUsers(){
// Creating movieclips
for (var i:Number=0; i<globals.scoreList.length;i++)
{
var test:MovieClip = new userbox();
test.x= lastx;
lastx = lastx+104.3;
test.name = String(i);
competencyContainer.addChild(test);
}
}
function moveRight(eventObject:MouseEvent){
trace("right Pressed");
trace(competencyContainer);
for(var childName in competencyContainer){
trace("child movieclip: " + competencyContainer[childName]);
}
影片剪輯在屏幕上完美製作,不會出錯。上面的代碼運行。但不顯示
trace("child movieclip: " + competencyContainer[childName]);
+1這是正確的做法。 – Amarghosh 2010-01-27 09:47:12
謝謝Ararghosh :) – 2010-01-27 15:18:39