ActionScript問題..........................

testMc1.testText.text="I Am Text Field1";
testMc2.testText.text="I Am Text Field2";
testBtn.addEventListener(MouseEvent.CLICK , testFtn);
function testFtn(event:MouseEvent):void {
        for (var i:uint=1; i<=2; i++) {
                trace(getChildByName("testMc"+i).testText.text);
        }
}

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

出錯 : 1119: Access of possibly undefined property testText through a reference with static type flash.display:DisplayObject.

Help!!!!!!!!!!!!!!

應該依句....唔可以 getChildByName 之後用點去攞下一個object...
trace(getChildByName("testMc"+i).testText.text);

[ 本帖最後由 kjky 於 2009-9-1 00:18 編輯 ]

TOP

咁有冇解救方法

TOP

解決左啦!!!!!
trace(this["testMc"+i].testText.text);

TOP