Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Display Random Text with Parameters

  • Display Random Text with Parameters

    Posted by Blane Granstaff on June 5, 2008 at 10:29 pm

    I am trying to create display that has a patient’s vital statistics like heart rate, temperature, blood pressure, etc. And I want to have these values refresh every two seconds and increase/decrease over time.
    For example I want the heart rate to stay within a range of 210-215 and change every two seconds. I am using the random number generator that allows for a range of values. The first problem I am running into is getting it to have no decimal points. The second problem is integrating the holdFrame expression that will allow it to only refresh every 60 frames. I am just diving into expressions and any help will be awesome.

    Darby Edelen replied 18 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Darby Edelen

    June 5, 2008 at 11:38 pm

    The easiest way to drop the decimals would be to use Math.round(x), which returns the nearest integer, or Math.floor(x), which returns the integer immediately below the current value, or Math.ceil(x), which returns the integer immediately above the current value.

    The easiest way to delay the update of the text is to delay the update of the expression with:

    posterizeTime(x);

    Where x is the number of times per second to update the returned value of the expression. If you wanted the expression to update every 2 seconds you would use:

    posterizeTime(.5);

    Darby Edelen
    Lead Designer
    Left Coast Digital
    Santa Cruz, CA

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