Thanks Taka and Cor, I did the TweenEvent.Motion_Change or motion_finish and it works. The tween event are not in any part of my book, or should I look better. Anyway, didn't have idea they existed.
Thanks.

Gustavo.
On Apr 1, 2009, at 3:01 PM, Taka Kojima wrote:

Sorry Cor,

Don't mean to contradict you, but there is also a
TweenEvent.MOTION_CHANGE event which gets fired whenever the tween
value changes.

Of course, a Timer would work as well.

On Wed, Apr 1, 2009 at 11:53 AM, Cor <c...@chello.nl> wrote:
Just FYI.
I guess it depends on what you are trying to achieve.
With the Timer option you could trace every position of the tween and
interact on values.


-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Taka Kojima
Sent: woensdag 1 april 2009 20:43
To: Flash Coders List
Subject: Re: [Flashcoders] how can I set the end of a dynamic tween

Actually, probably better off using a TweenEvent, instead of a Timer.

stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;


var ballXTween:Tween = new Tween(logoCacao, "y",Bounce.easeInOut,
logoCacao.y,
645, 2, true);

ballXTween.addEventListener(TweenEvent.MOTION_FINISH, onComplete);

function onComplete(e:TweenEvent):void{
removeEventListener(TweenEvent.MOTION_FINISH, onComplete);
//here is my problem when I try to calculate, when it hits the floor(645)
if(logoCacao.y>=645){
trace("I'm here");
}

}


On Wed, Apr 1, 2009 at 11:33 AM, Cor <c...@chello.nl> wrote:
Gustavo,

The IF statement is over before your logoCacao is on 645 so it is never
triggered.

Use a timer like this:

Var t:Timer = new Timer(10);
t.addEventListener(TimerEvent.TIMER, time_tick);
t.start();

function time_tick(e:TimerEvent):void{
if(logoCacao.y>=645){
trace("I'm here");
t.removeEventListener(TimerEvent.TIMER, time_tick);
t.stop();
t=null;
}
}

HTH
Cor


-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo
Duenas
Sent: woensdag 1 april 2009 20:12
To: Flash Coders List
Subject: [Flashcoders] how can I set the end of a dynamic tween



Hi Coders I have this code, is for a dynamic tween., pretty easy
actually but when the logo hits floor(645 value y) I would like to
have something else, because the logo is a movie clip, there is the
code.

stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;



var ballXTween:Tween = new Tween(logoCacao, "y",Bounce.easeInOut,
logoCacao.y,
645, 2, true);

//here is my problem when I try to calculate, when it hits the floor
(645)

if(logoCacao.y>=645){
trace("I'm here");
}

it would work with <=, but no with >= or ==
any ideas, I've been trying to resolve this too much time, I rather
have some fresh ideas or pointer what am I missing.

Gustavo





_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.278 / Virus Database: 270.11.35/2034 - Release Date: 04/01/09
06:06:00

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.278 / Virus Database: 270.11.35/2034 - Release Date: 04/01/09
06:06:00

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to