2 Replies Latest reply on Dec 7, 2017 7:01 PM by Mylenium

    Expression - Comp Name turns check box on or off

    111792

      Hey I'm trying to use a comp name to determine the opacity of a certain layer using expressions and I can't get it to work! I'm still very new to expressions and javascript, I was wondering if someone here might know the answer...

       

      My code:

       

      Under Checkbox:

       

      on = effect("Checkbox Control")("Checkbox");

      compName = comp("nbc. new year's eve").name;

      compStation = compName.substring(0, ".");

      n = "nbc"

       

       

      if (compStation == n) {

       

      on == 1;

      } else {

       

      on == 0;

      }

       

      Under Opacity:

       

      visibility = effect("Checkbox Control")("Checkbox");

       

      if (visibility == 0) { opacity = 100; } else {opacity = 0;}