goofy
goofy

Reputation: 75

EaselJS BitmapAnimation issue

i make my code like this

<script src="http://code.createjs.com/easeljs-0.6.0.min.js"></script>
<script src="http://code.createjs.com/preloadjs-0.3.0.min.js"></script>
<script type="text/javascript" src="src/easeljs/utils/UID.js"></script>
<script type="text/javascript" src="src/easeljs/geom/Matrix2D.js"></script>
<script type="text/javascript" src="src/easeljs/display/DisplayObject.js"></script>
<script type="text/javascript" src="src/easeljs/display/Container.js"></script>
<script type="text/javascript" src="src/easeljs/display/Stage.js"></script>
<script type="text/javascript" src="src/easeljs/events/MouseEvent.js"></script>
<script type="text/javascript" src="src/easeljs/display/Shape.js"></script>
<script type="text/javascript" src="src/easeljs/display/Graphics.js"></script>
<script type="text/javascript" src="src/easeljs/utils/Ticker.js"></script>
<script type="text/javascript" src="src/easeljs/display/SpriteSheet.js"></script>
<script type="text/javascript" src="src/easeljs/display/BitmapAnimation.js"></script>
<script type="text/javascript" src="src/easeljs/geom/Rectangle.js"></script>

<script>
var canvas;var stage;var rect;var bottle;
function init() {
canvas = new createjs.Stage("democanvas");
sheet = {"frames": [[120, 0, 60, 200, 0, -20, 0], [180, 0, 60, 200, 0, -20, 0], [240, 0, 58, 200, 0, -21, 0], [62, 0, 58, 200, 0, -21, 0], [0, 0, 62, 200, 0, -19, 0]], "images": ["swf/bottle.png"], "animations": {"sosro": {"frames": [1]}, "nu": {"frames": [2]}, "joy": {"frames": [0]}, "tra": {"frames": [4]}, "mizone": {"frames": [3]}}};
var ss = new createjs.SpriteSheet(sheet);
bottle = new createjs.BitmapAnimation(ss);
    canvas.addChild(bottle);
    bottle.x = 100;
    bottle.y = 100;
    createjs.Ticker.addEventListener('tick', canvas);
}
</script>
<canvas id="democanvas" width="500" height="200"  style="border:1px solid #000000; background-color:#999;" >
alternate content
</canvas>
<script>
    init();
</script>

But somehow my animation wont show. I use Zoe to produce the png javascript animation. Is there something missing in my script?

Upvotes: 0

Views: 398

Answers (1)

Lanny
Lanny

Reputation: 11294

I answered this on the community site. http://community.createjs.com/discussions/easeljs/967-bitmapanimataion-wont-show

Make sure to use gotoAndStop or gotoAndPlay on BitmapAnimations, or they won't show.

Upvotes: 1

Related Questions