Activity › Forums › Adobe After Effects Expressions › Can a variable be made of a condition?
-
Can a variable be made of a condition?
Posted by Andrew Kramer on August 26, 2007 at 12:34 pmI need to create a few variables that are conditional, is this possible? I’m sure I can create a workaround but just wondering.
Var=if (x <= 1) { random(max); } else { min; } Then another conditional script... Thanks, Andrew
Mike Clasby replied 18 years, 11 months ago 2 Members · 5 Replies -
5 Replies
-
Andrew Kramer
August 26, 2007 at 1:03 pmOkay, here is more specifics:
I need to execute 4 different scripts that are made up of a conditional If/else statement. This is essential.
These 4 states are dependent on the status of 2 checkboxes.
Check box 1
Check box 2Here are the four possible states of the 2 check boxes
A=1. 1 on 2 on
B=2. 1 on 2 off
C=3. 1 off 2 off
D=4. 1 off 2 onSo I need a conditional statement that will execute a specific conditional expression linked to one of these 4 scenarios.
something like this:
if A
execute script1
If B
Execute Script 2
If C
Execute Script 3
If D
Execute Script 4The only problem is that the scripts 1-4 are conditional statements as well.
So I need something link this?
if A
if…
If B
if…etc.
I’m working on an alternate solution now, but this would be easier.
-
Andrew Kramer
August 26, 2007 at 1:31 pmGot it, You can just keep puting conditions inside of conditions!
if (FreqSwitch > 0) {
if (MaxSwitch > 0) {
1
} else {
2
}
} else {
if (MaxSwitch > 0) {
3
} else {
4
}
}Then I can replace the numbers with complete conditions and it works perfectly. Sometimes writing things out sure helps.
-
Andrew Kramer
August 26, 2007 at 11:28 pmNot specifically, this is for a cool preset I’m working on. But now that I really have a handle on it, perhaps it is something I could share…
Reply to this Discussion! Login or Sign Up