ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

if else statements reading text property?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Robert Cox
if else statements reading text property?
on Aug 24, 2017 at 11:41:27 pm

Hello!

I'm hoping to inquire everyone's knowledge as I feel like this can be done somehow but I'm just not sure.

I'm creating a template for my company and I need to make it so if a text box has certain text, it will change the color of the box.

Basically, I have a gray box and if you type the letter "C" or "c" (for capitalization safety) it'll turn the gray box gold.

When entered the error I receive is that it's getting a text property where it's expecting a number, array, or property. Can I use an if then statement to read text boxes? If so, is my syntax incorrect?

x = comp("card").layer("rank").text.sourceText

if( x == "C" || x == "c") effect("Fill")("Color") == D2AE4C


Return to posts index

Dan Ebberts
Re: if else statements reading text property?
on Aug 25, 2017 at 12:41:14 am

Is the expression applied to a color property? If so, AE is expecting a four-element RGBA array, where each element is a number between 0 and 1. The RGBA array for the hex color D2AE4C would be [.8235,.6824,.2980,1] (I think).


Dan



Return to posts index

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