ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Randomize numbers between 1 and 9. Stops at Marker with comment

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Huub Borns
Randomize numbers between 1 and 9. Stops at Marker with comment
on Dec 22, 2017 at 3:15:42 pm

Hi there.

I'm doing a charity event were I want the total amount gotten to count up.

I don't want to animate the text because it's linked in Element 3D. And would like to keep it to 1 layer.
So i've tried doing it with an expression.

The text randomizes between 0 and 9. When it hits a marker with a comment, the text changes to the markers comment.
This works for the 2D text. But in the Element 3D layer, after it hits the marker it still keeps randomizing.

Is there another possibility to do this?

Cheers.

Huub

m = thisComp.layer("CIJFER 1");
n=0;
if (m.marker.numKeys > 0){
n = m.marker.nearestKey(time).index;
if (m.marker.key(n).time > time) n--;
}

if (n >0) {
m.marker.key(n).comment
}else{
Math.round(random(0,9));
}


Return to posts index

Kalleheikki Kannisto
Re: Randomize numbers between 1 and 9. Stops at Marker with comment
on Dec 23, 2017 at 8:21:57 am

Works just fine for me. Do your E3D, text and marker layers start at the samepoint (the beginning of the comp?)

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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