Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Getting value from SourceText with parseInt() expression

  • Getting value from SourceText with parseInt() expression

    Posted by Marissa Joyner on March 12, 2015 at 2:41 pm

    Hi!
    I have a bar graph that is getting its height value from a slider control. However, I’d like for the bar to get its value from a text layer (Source Text). For example, if you change the text layer to “50” the bar value would be 50. Of course if you simply pickwhip to the SourceText you get this error-

    Object of type TypeProperty found where a Number, Array, or Property is needed.

    It seems that the parseInt function would be the answer but I’m not sure how to write that expression. Or maybe there’s another way that doesn’t involve parseInt?

    Any ideas?
    Thanks!!

    After Effects template maniac
    https://www.fluxvfx.com/

    Marissa Joyner replied 11 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Declan Smith

    March 12, 2015 at 3:36 pm

    Below is an example of how to use parseInt to take a text layer (called MyTextLayer) source property as the input.

    Note that this will only work as is if the source text is entirely a number.

    parseInt(thisComp.layer("MyTextLayer").text.sourceText)

    Declan Smith
    https://www.madpanic.tv
    After Effects CS6/ FCS3 / Canon XLH1 / Canon 7D / Reason / Cubase

    “it’s either binary or it’s not”

  • Marissa Joyner

    March 12, 2015 at 5:11 pm

    Thank you!!

    After Effects template maniac
    https://www.fluxvfx.com/

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