PixelPush Posted December 20, 2016 Share Posted December 20, 2016 Anyone know how to define a repeat count for a tweenJS tween (using easeJs framework) ? The only option I can currently find is {loop:true} which causes infinite looping. //my code var solidsAnim = createjs.Tween.get(icon,{loop:true}) .to({y:solidOriginalY - 50}, 600 ,createjs.Ease.SineIn) Thanks ! Quote Link to comment Share on other sites More sharing options...
Anders Athletic Design Posted January 2, 2017 Share Posted January 2, 2017 I don't think there is an "easy" way to do it, but one way is to simply chain several tweens in a row. .to({y:solidOriginalY - 50} , 600).to( {... Another way is to loop and keep count in a "change" event handler and then stop the tween/loop from there: .to({y:solidOriginalY - 50}, 600 ,createjs.Ease.SineIn) .addEventListener("change", handleChange); function handleChange(e){ //check your counter and then e.target.removeTweens(e.target.target) //solidsAnim.removeTweens(icon) } PixelPush 1 Quote Link to comment Share on other sites More sharing options...
PixelPush Posted January 8, 2017 Author Share Posted January 8, 2017 Yes makes sense, Thanks ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.