1
我正在設置一個快速的小測試來開始挖掘EaselJS,但我得到這個錯誤,Uncaught ReferenceError: Stage is not defined
。我不確定爲什麼Stage沒有定義,因爲我爲Stage方法檢查了easeljs-NEXT.combined.js,它肯定在那裏。我在這裏做錯了什麼?Uncaught ReferenceError:舞臺沒有被定義使用EaselJS
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Easel Intro</title>
<!-- EaselJS Library -->
<script src="js/vendor/easeljs-NEXT.combined.js"></script>
<script>
var stage;
var text;
var logo;
function init()
{
stage = new Stage(document.getElementById("canvas"));
logo = new Bitmap("img/HTML5_Logo_64.png");
logo.regX = logo.image.width * 0.5;
logo.regY = logo.image.height * 0.5;
stage.addChild(logo);
text = new Text("Text rendered on the canvas.", "36px Arial", "#666");
text.x = 100;
text.y = 100;
stage.addChild(text);
stage.update();
}
</script>
</head>
<body onload="init();">
<canvas id="canvas" width="960" height="580"></canvas>
</body>
</html>
啊,謝謝!我從一些老例子開始操作。 – greyBow