Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createjs.Tween.removeTweens 的用法 #57

Open
leeenx opened this issue Jul 12, 2017 · 0 comments
Open

createjs.Tween.removeTweens 的用法 #57

leeenx opened this issue Jul 12, 2017 · 0 comments

Comments

@leeenx
Copy link
Contributor

leeenx commented Jul 12, 2017

createjs.Tween.removeTweens 的语法是:

createjs.Tween.removeTweens(target);

以下是官网解释:

Removes all existing tweens for a target. This is called automatically by new tweens if the override property is true.
Parameters:

target Object
The target object to remove existing tweens from.

target 其实是 DisplayObject 而不是 tween。

// 错误的用法
var tween = createjs.Tween.get(instance).to({xx: xxx}, 1000);
createjs.Tween.removeTweens(tween);

// 正确的用法 
var tween = createjs.Tween.get(instance).to({xx: xxx}, 1000);
createjs.Tween.removeTweens(instance); // 使用实例而不是tween
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant