ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

scroll text layer in segments

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Shai Benshoshan
scroll text layer in segments
on Jun 27, 2018 at 11:33:27 am

I am trying to create a scroll via expression.
the scroll action should be divided to segments: example: move 400px up, stop for 2 sec, then move 400px again, stop... the last block of text should also wait for 2 sec and move on.
I need to: 1.move, 2. update target positions, 3.move again
I thought using the for loop, with ease interpolation, but i can get it to move only once :

durMov = 5;
distance = 400
endPos = 2000;
var currentPos;
var finalPos;
for (i=5;position[1] 0; i--){

currentPos = position[1];
nextPos = currentPos+distance;

ease(time,0,durMov,currentPos,nextPos );
};

Thank You ;

durMov = 5;
distance = 400
endPos = 2000;
var currentPos;
var finalPos;
for (i=5;position[1] 0; i--){

currentPos = position[1];
nextPos = currentPos+distance;

ease(time,0,durMov,currentPos,nextPos );
};


Return to posts index

Dan Ebberts
Re: scroll text layer in segments
on Jun 27, 2018 at 1:09:02 pm

I'm not sure I understand everything you're trying to do, but I think it will look something like this:

moveDur = 5;
waitDur = 2;
moveAmt = 400;
t = time - inPoint;
segDur = moveDur+waitDur;
seg = Math.floor(t/segDur);
tSeg = t%segDur;
yOffset = seg*moveAmt + ease(tSeg,0,moveDur,0,moveAmt);
value - [0,yOffset]


Dan



Return to posts index

Shai Benshoshan
Re: scroll text layer in segments
on Jun 27, 2018 at 1:46:36 pm

thank you dan, it is exactly what I needed!
all the best to you :-)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]