File tree 3 files changed +25
-3
lines changed
3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,11 @@ g.setStrokeStyle(8)
45
45
46
46
// Add the item to our stage, and call .tick(); to draw the object.
47
47
var stage = new createjs.Stage (c);
48
- stage .addChid (shape);
48
+ stage .addChild (shape);
49
49
stage .tick ();
50
50
51
- // Create a PNG file
52
- fs .writeFile (__dirname + ' /public/circle.png' , c .toBuffer ());
51
+ // Create a PNG file.
52
+ fs .writeFile (__dirname + ' /public/circle.png' , c .toBuffer (), function () {
53
+ createjs .Ticker .halt ();
54
+ });
53
55
```
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ p.handleVideoEncoded = function () {
89
89
var cmd = "find " + __dirname + "/output -name '*.png' -exec rm -f {} \\;" ;
90
90
exec ( cmd ) ;
91
91
this . success ( 'video.mpg' ) ;
92
+
93
+ createjs . Ticker . halt ( ) ;
92
94
}
93
95
94
96
p . loadImage = function ( name ) {
Original file line number Diff line number Diff line change @@ -115,3 +115,21 @@ for (var i = 0; i < classes.length; i++) {
115
115
var name = path . split ( '/' ) . pop ( ) ;
116
116
require ( './' + path + '.js' ) [ name ] ;
117
117
} ;
118
+
119
+ /**
120
+ * Inject custom functionality that is only required on the server.
121
+ * So we can keep the same EaselJS source desktop / server.
122
+ *
123
+ */
124
+
125
+ /**
126
+ * Inject a halt method for Ticker.
127
+ * Clears the Ticker's Timeout, and stops all animation.
128
+ * Should only be called when your ready to stop the node instance.
129
+ *
130
+ */
131
+ createjs . Ticker . halt = function ( ) {
132
+ if ( createjs . Ticker . timeoutID !== null ) {
133
+ clearTimeout ( createjs . Ticker . timeoutID ) ;
134
+ }
135
+ }
You can’t perform that action at this time.
0 commit comments