Jump to content
Search Community

Tweens with delay

k1rsan test
Moderator Tag

Recommended Posts

Hello,

 

I have a question about tweens that have a delay at the beginning.

//init
var highScoreTween:TweenLite= new TweenLite(highScore, 0.4, { delay:1, alpha:1 } );


//here is the question
if (highScoreTween.time() < highScoreTween.duration()) {
	highScoreTween.seek(highScoreTween.duration());
}
			
		

If I want to check tween for activity, when it has already started, but delay time has not passed. The function time() returns 0 and propertie _active is false.

 

How can I know that this tween has already begun?

Link to comment
Share on other sites

Right, the delay just affects where the tween gets positioned on its parent timeline, but the tween isn't somehow "active" during its delay period (I think that would be counter-intuitive). You can easily get the info you're after, though, like this:

var timelineTime = highScoreTween.timeline.time();
var tweenStart = highScoreTween.startTime();
if (timelineTime > tweenStart - highScoreTween.delay() && timelineTime < tweenStart) {
    //it's inbetween the delay and the start
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...