FORUMS: list search recent posts

Counting Expresson not working.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Cuevas
Counting Expresson not working.
on Feb 15, 2012 at 7:58:47 pm

I add this expression to my Source text and I keep recieving an "invalid numeric result(divide by zero?) error.

If I change the "myNum = time" no error, it displays time + percent. Also if I just link to the slider, no error, my number is displayed.

It's not that I can't just put a percent sign behind the counter, I want to know why this isn't working

Thanks,

myNum = effect("Slider Control")("Slider");
myNum + "%"


Johnny Cuevas, Editor
Thinkck.com

"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.


Return to posts index


Dan Ebberts
Re: Counting Expresson not working.
on Feb 15, 2012 at 8:33:49 pm

Sometimes the expression engine doesn't automatically convert expression control objects to values and you have to explicitly tell it to do so, like this:

myNum = effect("Slider Control")("Slider").value;
myNum + "%"

This is another way to fix it:

myNum = effect("Slider Control")("Slider");
"" + myNum + "%"

Apparently forcing the string conversion (with the "") also causes the value to be retrieved.

Dan



Return to posts index

John Cuevas
Re: Counting Expresson not working.
on Feb 15, 2012 at 8:36:21 pm

Thank you Dan, that was driving me nuts. Good thing to remember for the future.

Johnny Cuevas, Editor
Thinkck.com

"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.


Return to posts index

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