TypeError not caught: Object # & lt; Object & gt; does not have a 'transitionTo' method

advertisements

After upgrading kineticjs from 4.0.5 to 4.5.1, I get

Uncaught TypeError: Object #<Object> has no method 'transitionTo'

Following code works with the previous version:

gameLayer.transitionTo({
        duration: '0.5',
        opacity: 1,
        callback: function() {
            intervalId = setInterval(reDraw, 33);
            isInteractive = true;

        }
    });

Whats the the alternative function for transitionTo in 4.5.1

UPDATE

I opened an issue over Github, according to the guy transitionTo has been removed and it is replaced by Tween

Regards,


You can use the onFinish attribute as below :

 var tween = new Kinetic.Tween({
    node: rect,
    duration: 1,
    x: 400,
    y: 30,
    rotation: Math.PI * 2,
    opacity: 1,
    strokeWidth: 6,
    scaleX: 1.5,
    onFinish: function() {console.log('onFinish');}
  });