hyperandroid / CAAT

Canvas Advanced Animation Toolkit
hyperandroid.github.com/CAAT
MIT License
727 stars 117 forks source link

How to add a method on complete event of RotateBehavior #171

Closed satya4satyanm closed 9 years ago

satya4satyanm commented 9 years ago

Hi Please help

var rotateBehaviour = new CAAT.RotateBehavior().setAngles(0, rotationNum).setDelayTime( 0, 12000); wheel.addBehavior(rotateBehaviour);

I need to call a method on completion of this behavior everytime

Thank you in advance Satya

robboerman commented 9 years ago

You can set a behaviorExpired method on your new behavior to do this.

var rotateBehaviour = new CAAT.RotateBehavior().setAngles(0, rotationNum).setDelayTime( 0, 12000);
rotateBehaviour.behaviorExpired = function(behavior, time, actor) {
    // Do your magic
}
satya4satyanm commented 9 years ago

Thanks Rob