Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions color change to blinking cursor expression

  • color change to blinking cursor expression

    Posted by Robert Paynter on August 19, 2014 at 8:09 pm

    I’m using this expression to animate a blinking cursor.
    I would like to change the color and size of the cursor. Is this possible?

    CH = Math.round(effect("LetterNumber")("Slider"));
    BlinkSpd = effect("BlinkSpeed")("Slider");
    F = Math.round((time * BlinkSpd) % 1); //result flickers between 0 and 1 for blinker on-off;
    TypeSpd = effect("LetterNumber")("Slider").speed;
    if (F==1 | TypeSpd > 0){Cursor = "|"} else {Cursor = "";}
    substr(0,CH) + Cursor;

    Robert Paynter replied 11 years, 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 19, 2014 at 9:21 pm

    You could add an animator for fill color and scale (set to what you want for the cursor), add an expression selector (delete the range selector), and set the expression selector’s amount expression to something like this:

    CH = Math.round(effect(“LetterNumber”)(“Slider”));
    if (textIndex < CH+1) 0 else 100

    Dan

  • Robert Paynter

    August 20, 2014 at 2:47 pm

    Thanks Dan. That worked Perfectly.

  • Robert Paynter

    September 16, 2014 at 6:55 pm

    I have an issue with this expression. When Justified Right, the line bounces back and forth with the blinking of the cursor. I understand why but is there any simple fix for it ? I added a space between the ” ” but that of course is not perfect.

    CH = Math.round(effect("LetterNumber")("Slider"));
    BlinkSpd = effect("BlinkSpeed")("Slider");
    F = Math.round((time * BlinkSpd) % 1); //result flickers between 0 and 1 for blinker on-off;
    TypeSpd = effect("LetterNumber")("Slider").speed;
    if (F==1 | TypeSpd > 0){Cursor = "|"} else {Cursor = " ";}
    substr(0,CH) + Cursor;

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy