Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to switch/change between same characters?

  • Expression to switch/change between same characters?

    Posted by Kazimir Bielecki on December 7, 2016 at 1:33 pm

    Hello,

    I need to create a method or expression to switch/change between same characters within a word.

    For instance…

    CAT, could alternate between, ACT, TCA, ATC, TAC and so on.

    I’ve tried adding a character offset from the animate button but when I cycle the offset is gives me a completely different set of numbers and letters.

    If there is a method/expression, is it possible to be able to use the same expression at different speeds and with different text?

    I would appreciate some help on adding some expressions to do this. I am a rookie looking to learn.

    Dan Ebberts replied 9 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    December 7, 2016 at 6:29 pm

    Something like this might work:


    dur = 1; // change every second
    txt = value;
    seg = Math.floor(time/dur);
    seedRandom(seg,true);
    a = [];
    for (i = 0; i < txt.length; i++) a.push(i);
    for (i = 0; i < txt.length; i++){
    idx = Math.floor(random(txt.length));
    temp = a[i];
    a[i] = a[idx];
    a[idx] = temp;
    }
    outStr = "";
    for (i = 0; i < txt.length; i++){
    outStr += txt[a[i]];
    }
    outStr

    Dan

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