속성 및 함수를 특정 js 클래스로 선언하려고합니다. 객체 [개체 개체]있는 방법이 없습니다 'addButtonEventListeners자바 스크립트 클래스 함수 내에서 함수 호출?
내 코드를 나열 : SplashScene.js
나는 (선언 후라고하더라도) 함수 내에서 함수를 호출 할 때 그러나 그것은 예외를catch되지 않은 형식 오류가 발생합니다
var anim1, background;
var SplashScene;
function SplashScreen(SceneContainer)
{
this.name = "SplashScreen";
this.loadScreen = function()
{
background = new createjs.Shape();
background.graphics.beginBitmapFill(loader.getResult("gameLoopSplash")).drawRect(0,0,w,h);
SplashScene = new createjs.Container();
anim1 = new createjs.Sprite(buttonData, "playIdle");
anim1.framerate = 30;
anim1.x = 260;
anim1.y = 22;
SplashScene.alpha = 0;
SplashScene.addChild(background);
SplashScene.addChild(anim1);
}
this.addButtonEventListeners = function()
{
console.log("addButtonEventListeners SplashScreen");
}
this.menuIn = function()
{
console.log("menuIn SplashScreen");
stage.addChild(SplashScene);
var tween = createjs.Tween.get(SplashScene).to({y : 0, x : 0, alpha : 1}, 5000).call(this.menuInCompleted);
var splashTimer = window.setTimeout(function(){menuOut("MainScreen", false)},15000);
}
this.menuInCompleted = function()
{
console.log("menuInCompleted SplashScreen");
this.addButtonEventListeners();
}
}
아무도 말해 줄 수 있습니까?
메뉴가 작동하지만, 메뉴 밖으로되지 않습니다. 네가 한 말대로했다. 하지만 여전히 작동하지 않습니다. – starrystar