28 Replies Latest reply on Nov 8, 2017 7:53 AM by charlesn79540358

    change symbol background color by code

    charlesn79540358 Level 1

      hello,

      Is there a way to change symbol background color by code dynamically?

      i have it working like this.

       

      function changebackground(hotbutton){

       

       

       

       

      switch (hotbutton){

      case "  2":

       

       

      exportRoot.hotbtn_3.shape_1.graphics.f("#00FFFF").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwAB QAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");

      exportRoot.hotbtn_2.shape_1.graphics.f("#FF9900").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwAB QAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");

      exportRoot.hotbtn_2a.shape_1.graphics.f("#FF9900").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwA BQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");

      exportRoot.hotbtn_2b.shape_1.graphics.f("#FF9900").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwA BQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");

      break;

      case "  3":

      exportRoot.hotbtn_2.shape_1.graphics.f("#00FFFF").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwAB QAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");

      exportRoot.hotbtn_2a.shape_1.graphics.f("#00FFFF").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwA BQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");

      exportRoot.hotbtn_3.shape_1.graphics.f("#FF9900").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwAB QAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");

      break;

      }

       

      }

       

      but I'm changing the back ground color by doing it hard coded. I don't want to do this for 10-15 symbols.

       

      thanks