Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions counting expression

  • counting expression

    Posted by Justin Young on May 26, 2010 at 3:33 am

    I’m trying to use an expression I found here and get it to work with a variable value, but I keep getting errors.

    Any ideas on why it’s not working?

    startTime = 1.5; //in seconds
    endTime = 5; //in seconds
    startValue = 0;
    endValue= comp("INFO").layer("showNumber").text.sourceText);
    linear (time, startTime, endTime, startValue, endValue)

    Justin Young replied 15 years, 11 months ago 2 Members · 3 Replies
  • 3 Replies
  • Ram Manohar

    May 26, 2010 at 12:18 pm

    Hi Justin.., i think using of “parseInt()” will solve your problem…

    add the bold line in your code..

    startTime = 1.5; //in seconds
    endTime = 5; //in seconds
    startValue = 0;
    sTextValue=parseInt(comp(“INFO”).layer(“showNumber”).text.sourceText));
    endValue=sTextValue ;

    linear (time, startTime, endTime, startValue, endValue)

    and check it out….

    for AE scripts click here

    manohar

  • Justin Young

    May 26, 2010 at 1:29 pm

    no dice, I tried it but it didn’t work.

  • Justin Young

    May 26, 2010 at 3:14 pm

    I actually got it working now. The semi colon at the end was screwing it up.

    beginTime = 0;
    endTime = 2;
    startVal = 100;
    endVal = parseInt(comp(“INFO”).layer(“showNumber”).text.sourceText)
    Math.round(linear(time,beginTime,endTime,startVal,endVal))

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