0
我有這樣的代碼,但是當我運行它,它給了我:類型錯誤:錯誤#1006:值不是一個函數
TypeError: Error #1006: value is not a function.
at Main/startUp()
at Main/refresh()
我不明白爲什麼它是這樣說,有人可以賜教?該代碼是檢查是否設置currentFrame是2,如果是,那麼它運行啓動,並增加了主菜單到舞臺,從那裏,它增加了事件監聽器的按鈕,下面的代碼:
package
{
import flash.display.MovieClip;
import flash.display.StageQuality;
import flash.events.Event;
import flash.events.MouseEvent;
/**
* ...
* @author Andre
*/
public class Main extends MovieClip
{
var toStart:Boolean = true;
public function Main()
{
stage.addEventListener(Event.ENTER_FRAME, refresh);
}
function refresh(e:Event):void
{
if (this.currentFrame == 2 && toStart == true)
{
startUp();
toStart = false;
}
}
function startUp():void
{
var startScreen:lstartScreen = new lstartScreen();
addChild(startScreen);
//startScreen.startScreen_play.addEventListener(MouseEvent.CLICK, startGame)
startScreen.startScreen_quality.startScreen_quality_high(MouseEvent.CLICK, changeQuality);
startScreen.startScreen_quality.startScreen_quality_medium(MouseEvent.CLICK, changeQuality);
startScreen.startScreen_quality.startScreen_quality_low(MouseEvent.CLICK, changeQuality);
}
function changeQuality(e:MouseEvent):void
{
}
}
}
設我知道你是否需要更多信息,或者我是否忘記了一些事情。