내가 캔버스를 얻고, 난이 문자열 오류 얻을 무대 작성을 위해 보내방법은 easeljs에 오류를 반환 createjs.Stage
Uncaught TypeError: Cannot call method 'addEventListener' of undefined.
내 init 함수 :
function init() {
canvas = document.getElementById("testCanvas");
stage = new createjs.Stage(canvas);
screen_width = canvas.width;
screen_height = canvas.height;
contentManager = new ContentManager();
contentManager.SetDownloadCompleted(startGame);
contentManager.StartDownload();
}
블록을 코드의 부여 오류 :
p.enableDOMEvents = function(enable) {
if (enable == null) { enable = true; }
var n, o, ls = this._eventListeners;
if (!enable && ls) {
for (n in ls) {
o = ls[n];
o.t.removeEventListener(n, o.f);
}
this._eventListeners = null;
} else if (enable && !ls) {
var t = window.addEventListener ? window : document;
var _this = this;
ls = this._eventListeners = {};
ls["mouseup"] = {t:t, f:function(e) { _this._handleMouseUp(e)} };
ls["mousemove"] = {t:t, f:function(e) { _this._handleMouseMove(e)} };
ls["dblclick"] = {t:t, f:function(e) { _this._handleDoubleClick(e)} };
t = this.canvas;
if (t) { ls["mousedown"] = {t:t, f:function(e) { _this._handleMouseDown(e)} }; }
for (n in ls) {
o = ls[n];
o.t.addEventListener(n, o.f);
}
}
특히이 블록 :
,536,for (n in ls) {
o = ls[n];
o.t.addEventListener(n, o.f);
}
'n'값이 BitmapAnimation_initialize
인 경우 오류가 발생합니다. 이 코드를 Stage.js에서 찾았습니다. 파일이 easeljs의 rar와 함께 나타납니다.