0

So I have spritesheet i have almost looked everywhere nor i can find good tutorial neither i can get this thing to work .Can some one point it out for me that what's wrong here.?Coz none error is generated nor is anythign getting showed on the canvas .
var result = queue.getResult("avatar1");

        var data=
        {
             images: [ result],

    // The 5th value is the image index per the list defined in "images" (defaults to 0).
    frames: [
        // x, y, width, height, imageIndex, regX, regY
        //head_south":{"x":120,"h":20,"y":138,"w":15}
        [120,138,15,20],
        [64,0,15,20,2],
        ],

        animations: {

            show: { frames: [0,1], next: true, frequency: 1 }

    }
    };

    var sp = new createjs.SpriteSheet(data);
    createjs.Ticker.setFPS(60);
    var sprite_anim = new createjs.BitmapAnimation(sp,"show");
    sprite_anim.x=100;
    sprite_anim.y=100;
    stage.addChild(this.sprite_anim);
    sprite_anim.play("show");
    sprite_anim.gotoAndPlay('show');

2 Answers2

0

Do you update the stage with the ticker ? :

createjs.Ticker.addEventListener("tick", function(event) {
    stage.update(event);
});
Mister D.
  • 661
  • 5
  • 9
  • 4 arguments [120,138,15,20], 5 arguments [64,0,15,20,2] Seems like it was more isssue of varaiable not being gloabal.So i made the variables global then it gave error something like "create js type error" so i figured out that it takes 4 arugment or 7 but not 5 so i changed it to 4 ,now it works fine .Thanks for your concern Appreciated – Yawr Mailk Oct 21 '13 at 13:15
0

4 arguments [120,138,15,20], 5 arguments [64,0,15,20,2] Arguments that are allowed are either 4 or 7.So changed back to 4.That was why it was generating error of" createjs type error '. Thank everyone for your conern .Closing this question.