# After Effects Expressions

Currently Being Moderated

## Very basic Radial Wipe / Opacity expression

### Oct 17, 2011 3:40 AM

Hey Guys

Sorry for asking what is probably a super elementary question. Why doesn't my simple expression below achieve the result of dropping the opacity by 25 for each quarter of completion? Am I missing something basic? Instead it stays at 100% until the final quater where it drops to 25. Im pretty fresh at expressions so hope sorry if such a function is written wrong.

Cheers

EXPRESSION ON OPACITY

if (trans<=75 && trans>50){

75}

if (trans<=50 && trans>25){

50}

if (trans<=25 && trans>0){

25} else {100};

Replies
• Currently Being Moderated
Oct 17, 2011 3:55 AM   in reply to Claytdude

The last if statement always results in 20 or 100. You could write it like this:

if (trans<=75 && trans>50){

75

} else if (trans<=50 && trans>25){

50

} else if (trans<=25 && trans>0){

25

} else {

100

};

or you could do something like:

if (trans ==0) {

100

} else {

Math.ceil(trans/25) * 25;

}

|
Mark as:
Actions

#### More Like This

• Retrieving data ...

#### Answers + Points = Status

• 10 points awarded for Correct Answers