ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Typewriter , remove text using expression substr

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Peter Sparks
Typewriter , remove text using expression substr
on Apr 6, 2019 at 9:44:39 pm

HI Guys

I am new to AE, and the expressions and cannot work out the formula to reduce the text after its been written out.
In effect I am trying to produce a few statements which get typed out, then untyped and then another on another layer would be typed.

I have the expression from the net which types out the words the first time, but how to do this in reverse after say 1/2 seconds of completing the string?

Thank you for any help.

F = Math.round(time*effect("Blink Speed")("Slider") % 1);
L = X.length;
T = time*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");

Cursor = " ";
if (F==1 | T>0) Cursor = "|";
if(F==1 |(T0)){Cursor="|";}else{Cursor=" ";}


if (T>0 ) X.substr(0,T) + Cursor
else Cursor


Return to posts index

Kalleheikki Kannisto
Re: Typewriter , remove text using expression substr
on Apr 7, 2019 at 6:43:08 pm

It seem likely you could achieve it with the existing expression by changing (keyframing) the start time and speed so that it would work in reverse. Meaning the speed would be negative and the start time would change to account for completing the write-in part first. It's too late at night for me to figure out what the start time would have to be to do that, but you should be able to figure that out by experimenting.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Peter Sparks
Re: Typewriter , remove text using expression substr
on Apr 8, 2019 at 10:03:53 am

Thank you for your thoughts, I am not sure I follow completly if I am honest, but I will keep going and see if I cam can get it working.

I was experimenting with trying to work out if the text was fully written ( at full length) and not only in part, then to reduce the substr count over a growowing time which will achieve the un typing effect. No joy as of yet...


Return to posts index


Kalleheikki Kannisto
Re: Typewriter , remove text using expression substr
on Apr 8, 2019 at 2:10:07 pm

Worked just fine.

Example:
Text: "Typing some text here are we?"
Hold keyframe at 0: Speed 10, Blink Speed 1, Start at 2
Hold keyframes at 10 sec: Speed -10, Start at 14

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Peter Sparks
Re: Typewriter , remove text using expression substr
on Apr 8, 2019 at 2:11:34 pm

Sorry how do i put this into the expression?
Thank you again for your help .


Return to posts index

Kalleheikki Kannisto
Re: Typewriter , remove text using expression substr
on Apr 8, 2019 at 2:15:19 pm

You don't put that in the expression, you keyframe the sliders.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index


Kalleheikki Kannisto
Re: Typewriter , remove text using expression substr
on Apr 8, 2019 at 2:12:47 pm
Last Edited By Kalleheikki Kannisto on Apr 8, 2019 at 2:14:13 pm

Did have to fix two lines in the expression though.

X = text.sourceText;//<<<<Added this line
F = Math.round(time*effect("Blink Speed")("Slider") % 1);
L = X.length;
T = time*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");

Cursor = " ";
if (F==1 | T>0) Cursor = "|";
if(F==1 |(T==0){Cursor="|";}else{Cursor=" ";}//<<<< T==0


if (T>0 ) X.substr(0,T) + Cursor
else Cursor


Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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