[Tweener] Adding tween
Zeh Fernando
zeh at zehfernando.com
Sat Jan 16 07:00:09 PST 2010
I'm not sure exactly why you're trying this, but if you're tweening, you
don't use onEnterFrame. It'd be something like this:
function moveClip(p_clip:MovieClip, p_dir:String, p_distance:Number):Void {
if (p_dir == "up") {
Tweener.addTween(p_clip,{_y: p_clip.y - p_distance, time:1});
}else {
Tweener.addTween(p_clip,{_y:p_clip.y + p_distance, time:1});
}
}
Zeh
On Sat, Jan 16, 2010 at 8:52 AM, Adrien <realeon at hotmail.com> wrote:
> 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
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20100116/11393355/attachment.htm>
More information about the Tweener
mailing list