ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to switch/change between same characters?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kazimir Bielecki
Expression to switch/change between same characters?
on Dec 7, 2016 at 1:33:15 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.


Return to posts index

Dan Ebberts
Re: Expression to switch/change between same characters?
on Dec 7, 2016 at 6:29:52 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



Return to posts index

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