ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Getting value from SourceText with parseInt() expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marissa Joyner
Getting value from SourceText with parseInt() expression
on Mar 12, 2015 at 2:41:04 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/


Return to posts index


Declan Smith
Re: Getting value from SourceText with parseInt() expression
on Mar 12, 2015 at 3:36:15 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
http://www.madpanic.tv
After Effects CS6/ FCS3 / Canon XLH1 / Canon 7D / Reason / Cubase

"it's either binary or it's not"


Return to posts index

Marissa Joyner
Re: Getting value from SourceText with parseInt() expression
on Mar 12, 2015 at 5:11:39 pm

Thank you!!

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


Return to posts index

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