Quantcast
Channel: Adobe Community : All Content - After Effects
Viewing all articles
Browse latest Browse all 49102

Expression: I am stuck

$
0
0

Hi, could someone please tell me whats going on here:

 

var i=1;

var Banana;

if (comp("Comp 1").layer("Calender_Pre").effect("STAY!")("Checkbox") == 0)

//i = 0

Banana = 20

 

else if (i == 0)

//i++

Banana = 25

 

else if (i >= 0)

Banana = 13;

(Banana);

 

This code seems to work fine until i uncomment either "i=0" on line 4, or "i++" on line 8. If i uncomment "i=0" i get "Error at line 7...illegal use of reserved keyword 'else'", when i uncomment "i++" i get the same Error at line 11.

 

Why am i allowed to assign a value to "Banana" inside the if statements, but not to "i"?

 

Thanks and kind regards,


Viewing all articles
Browse latest Browse all 49102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>