createjs

EaselJS Keyboard Ticker Problems

你说的曾经没有我的故事 提交于 2019-12-25 05:09:23
问题 I'm experimenting with EaselJS for the first time, and I'm trying to make a normal square move. I created used a Ticker to animate a square from the left to the right of the screen. It seemed choppy, so I raised the FPS of that ticker (via Ticker.setFPS(60) ). My next step is to add keyboard events to allow the square to move. I've done so successfully, but the same choppiness has come back. I've tried setting the FPS of the Ticker to a higher rate, which isn't fixing my problem at all. Here

duplicating objects with easeljs

对着背影说爱祢 提交于 2019-12-24 14:29:54
问题 I keep having problems trying to reuse elements using the easeljs library. Whether I use the clone() method, where I can only get one instance and then events like onPress will stop working for the new elements. Adding the same object on more than one container will make the object to disappear everywhere. I keep having to find workarounds around this, messing up my code and wasting resources. Thanks in advance for any help or tip. 回答1: if you are using Shape's Graphics , you might want to

Touch Events not registering for HTML5 Canvas Authoring using Flash CC

不羁岁月 提交于 2019-12-24 03:45:11
问题 I have been having some issues when it comes to authoring HTML 5 Canvas in Flash CC, mostly as a result of the lack of information on writing JavaScript inside Flash. I have been converting an existing drag and drop .fla into HTML 5 with the hope of making it iOS and Android compatible. It is already functioning with mouse, but I have hit a brick wall on trying to add touch support. The only way I have been able to even register the touch events is by listening to the entire window, which isn

Dynamic Stage name in EaselJS

只愿长相守 提交于 2019-12-24 01:26:17
问题 I'm currently working on a site designed to display multiple canvases at the same time, without knowing which canvases it's going to display in advance (a PHP script creates the list). The idea is to have multiple script files (one per canvas) be read by (typically) a single handler which will populate the individual stages. stage = new createjs.Stage(context); I'm stuck here. At the time I create a given stage, I know the name of the canvas I want to attach it to (for instance, stageA) and

CreateJS / Adobe Animate CC: testing a simple function

こ雲淡風輕ζ 提交于 2019-12-23 06:05:39
问题 I'm trying to test run a simple function that's declared in the first frame. When I write fl_DoRestart(); on frame 50 I get the following error: Uncaught ReferenceError: fl_DoRestart is not defined , but it's defined on frame one. Why's this not working? This used to be very simple in actionscript :( I eventually need to be able to call this function from another function, right now I'm just testing it. Here's my function on frame one: function fl_DoRestart(){ this.gotoAndPlay(1); console.log

CreateJS / Adobe Animate CC: testing a simple function

做~自己de王妃 提交于 2019-12-23 06:05:28
问题 I'm trying to test run a simple function that's declared in the first frame. When I write fl_DoRestart(); on frame 50 I get the following error: Uncaught ReferenceError: fl_DoRestart is not defined , but it's defined on frame one. Why's this not working? This used to be very simple in actionscript :( I eventually need to be able to call this function from another function, right now I'm just testing it. Here's my function on frame one: function fl_DoRestart(){ this.gotoAndPlay(1); console.log

Targetting multiple Stages' children by name in EaselJS

人盡茶涼 提交于 2019-12-23 04:27:15
问题 (Continuation of this question.) So let's assume I have two stages and I want to update them simultaneously at a tick. $( document ).ready(function() { context = "First"; init(); context = "Second"; init(); createjs.Ticker.addEventListener("tick", tick); createjs.Ticker.setFPS(12); }); stages = [ "First", "Second" ] canvases = { "First": [ {"content": "small1.png"} ], "Second": [ {"content": "small2.png"} ] }; objects = []; function init() { window[context] = new createjs.Stage(context);

Loop part of a tween with tween.js

半城伤御伤魂 提交于 2019-12-22 08:54:47
问题 Here's a simple tween in Tween.js. A simple loop happens after an interval. cjs.Tween.get(mySymbol).wait(50).to({x:10}).to({x:0}); Is there a way to make it repeat say 5 times after the interval, without repeating the interval? By adding loop:true I can make it loop but the loop would include the wait(). cjs.Tween.get(mySymbol, {loop:true}).wait(50).to({x:10}).to({x:0}); Is there any way to add tweens to the timeline sequentially in Tween.js? 回答1: Answer courtesy of Grant Skinner: cjs.Tween

FlashDevelop, Haxe import CreateJS?

我们两清 提交于 2019-12-20 02:42:08
问题 I just started trying out Haxe to make a web-app, and I would like to use CreateJS, which has a Haxe extern lib thingy. I'm using FlashDevelop as my IDE. So I created a new Haxe JS project in FlashDevelop, and installed CreateJS with "haxelib install createjs". Thougg now I try to add an import to my Main.hx, but it doesn't work. My import looks like: "import createjs.easeljs.Ticker;" (got that from an example, just copied it but didn't work :s) I also added a new map "lib" to my project, in

FlashDevelop, Haxe import CreateJS?

喜欢而已 提交于 2019-12-20 02:41:34
问题 I just started trying out Haxe to make a web-app, and I would like to use CreateJS, which has a Haxe extern lib thingy. I'm using FlashDevelop as my IDE. So I created a new Haxe JS project in FlashDevelop, and installed CreateJS with "haxelib install createjs". Thougg now I try to add an import to my Main.hx, but it doesn't work. My import looks like: "import createjs.easeljs.Ticker;" (got that from an example, just copied it but didn't work :s) I also added a new map "lib" to my project, in