0
這是一個影片剪輯功能稱爲級別父。未定義
function makeLvl():void
{//this function will add bells to the stage
bellTime ++;//increment the time
if(bellTime >= bellLimit)
{//if the time for bell creation has been reached
bellTotal ++;//increase the amount of bells created
var newBell:Bell = new Bell();//create a new bell instance
this.addChild(newBell);//and add it to bellHolder
bellTime = 0;//reset the time for another creation
bells.push(newBell);
}
}
這將創建幾個孩子影片剪輯中的水平。 現在,裏面貝爾(),我希望訪問一些變量是這樣的:
parent.bellTotal = 0;
但它說:
Access of possibly undefined property bellTotal through a reference with a static type flash:DisplayObjectContainer
這是什麼錯誤,爲什麼它從工作停止我的代碼?謝謝
(父爲影片剪輯)完美地工作;謝謝 – 2012-02-01 08:35:27