ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Setting a Time Limit

FAQ   •   VIEW ALL
 Setting a Time Limit on Jun 15, 2009 at 12:28:09 am

Hi,

In this Eran Stern tutorial,

http://library.creativecow.net/articles/stern_eran/Promo_Breakdown_Part_1/v...

he uses an expression for movement.

time*2

Suppose I have a 10 second composition and I want this movement to last for only 5 secs, how would I do this ?

Raj

 Re: Setting a Time Limiton Jun 15, 2009 at 12:52:49 am

multiple ways to do it.
Something like this will work:

``` t=Math.min(t,5); t*2; ```

Math.min takes the smallest value,
so as long as time<5 t=time, if time>5, t stays at 5

another way:

``` t=linear(t,0,5,0,5); t*2; ```

this reads harder, but has the exact same result.
But, you can change the linear() to ease() and you won't get a sudden stop.

 Re: Setting a Time Limiton Jun 15, 2009 at 12:53:43 am

sorry, that should have been:

``` t=linear(time,0,5,0,5); t*2; ```

 Re: Setting a Time Limiton Jun 15, 2009 at 5:13:07 am

Hey man, thanks a lot.

t=linear(time,0,5,0,5);
t*2;

so, if in my comp of 10 secs if I want it to affect only till 3 seconds...

then t=linear(time,3,5,10,5)
t*2