Javascript 在AdobeFlashCreateJS工具包中使用Meteor
我想知道如何使用内部流星 对于简单的矩形和圆形,生成的html和js如下所示: create-demo.htmlJavascript 在AdobeFlashCreateJS工具包中使用Meteor,javascript,node.js,flash,meteor,createjs,Javascript,Node.js,Flash,Meteor,Createjs,我想知道如何使用内部流星 对于简单的矩形和圆形,生成的html和js如下所示: create-demo.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>create-demo</title> <script src="http://code.createjs.com/easeljs-0.7.0.min.js"></scrip
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>create-demo</title>
<script src="http://code.createjs.com/easeljs-0.7.0.min.js"></script>
<script src="create-demo.js"></script>
<script>
var canvas, stage, exportRoot;
function init() {
canvas = document.getElementById("canvas");
exportRoot = new lib.createdemo();
stage = new createjs.Stage(canvas);
stage.addChild(exportRoot);
stage.update();
createjs.Ticker.setFPS(lib.properties.fps);
//createjs.Ticker.addEventListener("tick", stage);
}
</script>
</head>
<body onload="init();" style="background-color:#D4D4D4">
<canvas id="canvas" width="550" height="400" style="background-color:#FFFFFF"></canvas>
</body>
</html>
我为meteor安装了这个createjs包,这意味着我可能不需要导入
我的问题是,将此代码添加到meteor项目中的最佳方式是什么
基本的流星计划是这样的
testapp.html
<head>
<title>testapp</title>
</head>
<body>
{{> hello}}
</body>
<template name="hello">
<h1>Hello World!</h1>
{{greeting}}
<input type="button" value="Click" />
</template>
请注意,在CreateJS管理的
画布
中,您将无法获得Meteor的任何spiffy功能(反应模板等)。也就是说,这样做:
client
、lib
、server
和client/lib/createjs
create demo.js
移动到client
中client/lib/createjs
中client/index.html
(注意没有script
元素):
这对我不起作用。我有编译错误。如果您愿意详细说明,也许我们可以提供帮助。我有一个想法,修改了第3步和第4步,试着这样做。也试着删除你通过Meteorite安装的createjs包,可能会有冲突。你找到解决方案了吗?请发布您的解决方案或问题,以帮助他人。我不希望有人在某一天看到这篇文章,认为CreateJS和Meteor是不兼容的,如果他们真的兼容的话。
<head>
<title>testapp</title>
</head>
<body>
{{> hello}}
</body>
<template name="hello">
<h1>Hello World!</h1>
{{greeting}}
<input type="button" value="Click" />
</template>
if (Meteor.isClient) {
Template.hello.greeting = function () {
return "Welcome to testapp.";
};
Template.hello.events({
'click input': function () {
// template data, if any, is available in 'this'
if (typeof console !== 'undefined')
console.log("You pressed the button");
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>create-demo</title>
</head>
<body style="background-color:#D4D4D4">
<canvas id="canvas" width="550" height="400"
style="background-color:#FFFFFF"></canvas>
</body>
</html>
var canvas, stage, exportRoot;
function init() {
canvas = document.getElementById("canvas");
exportRoot = new lib.createdemo();
stage = new createjs.Stage(canvas);
stage.addChild(exportRoot);
stage.update();
createjs.Ticker.setFPS(lib.properties.fps);
//createjs.Ticker.addEventListener("tick", stage);
}
Meteor.startup(function () {
init();
});