[Tweener] Adding tween
Adrien
realeon at hotmail.com
Sat Jan 16 05:52:54 PST 2010
Hello I'm trying to add a tween to this
import caurina.transitions.Tweener;
function moveClip(p_clip:MovieClip, p_dir:String,
p_distance:Number):Void {
p_clip.count = 0;
p_clip.onEnterFrame = function() {
p_clip.count++;
if (p_dir == "up") {
this._y -= 1;
}else {
this._y += 1;
}
if (this.count == p_distance) {
trace(this)
delete this.onEnterFrame;
}
}
}
I've tried this but doesn't work... do you know what I'm doing wrong?
it has something to do with the minus and plus but why?
import caurina.transitions.Tweener;
function moveClip(p_clip:MovieClip, p_dir:String,
p_distance:Number):Void {
p_clip.count = 0;
p_clip.onEnterFrame = function() {
p_clip.count++;
if (p_dir == "up") {
Tweener.addTween(this,{_y -:1, time:1});
}else {
Tweener.addTween(this,{_y +:1, time:1});
}
if (this.count == p_distance) {
trace(this)
delete this.onEnterFrame;
}
}
}
Regards
Adrien
More information about the Tweener
mailing list