Karl Mochel @karlmochel • Joined Nov 2018 • Active 6 years ago Remove Connection Are you sure you want to remove from your connections? Timeline Profile Connections Photos Forums Points Leader Badges Discussions Replies Favorites Discussions Replies Favorites Forum Replies Created Karl Mochel November 9, 2018 at 8:08 pm in reply to: AE2019 – Why does using “index” in an if statement throw an undefined value error? the .value makes no difference… Tried it with and without and it worked both ways. Karl Mochel November 9, 2018 at 7:04 pm in reply to: AE2019 – Why does using “index” in an if statement throw an undefined value error? So… {} around the {then/else statements} fixed this. // 1st form… if (thisComp.layer(“Control”).effect(“Slider Control”)(“Slider”) == index) {100} else {0}; // 2nd form… selected_state = thisComp.layer(“Control”).effect(“Slider Control”)(“Slider”).value; if (selected_state == index) {100} else {0}; The original code from this thread didn’t have them so I didn’t think to look at that as a problem. https://forums.creativecow.net/docs/forums/post.php?forumid=2&postid=986190&univpostid=986190&pview=t