Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Random Text using only these four letters GCTA

  • Random Text using only these four letters GCTA

    Posted by Andrea Stewart on February 9, 2015 at 9:46 pm

    I know this should be simple. How can I make a random text generator that sticks only to GCTA?

    Basically I want those letters to keep flipping and eventually settle on a certain sequence, eg GCTA as the result.

    Any help appreciated.

    Andrea Stewart
    Producer/Editor/Director – Owner
    Germane Creative LLC

    Kevin Camp replied 11 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kevin Camp

    February 9, 2015 at 11:47 pm

    create a text layer and type GCTA into it, then add this expression to the source text and it will randomly jumble just those letters.

    myText = text.sourceText.split( "" );
    newText = "";

    for ( i = 0 ; i < 4 ; i++ ){
    r = Math.floor( random( 4 ) );
    newText = newText + myText[ r ];
    }

    newText

    then you could simply cut between the text layer with the expression and a text layer with final letters in the right order…. but i think you may have something else planned as it animates to the final resolve, so the expression may need to change to accomplish what you are after.

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Kevin Camp

    February 10, 2015 at 12:45 am

    This expression will resolve the text one character at a time based on layer markers. simply add a layer marker at the point at which you want a letter to resolve.

    myText = text.sourceText.split( "" );

    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n--;
    }
    }

    newText = "";
    for ( i=n ; i<4 ; i++ ){
    r = Math.floor( random( 4 ) );
    newText = newText + myText[ r ];
    }

    text.sourceText.substr( 0,n ) + newText

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

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