Skip to main content
charlesn79540358
Inspiring
October 31, 2017
Answered

change symbol background color

  • October 31, 2017
  • 1 reply
  • 474 views

Hello,

Can you set the properties of a symbol by doing this hot_btn2.backgroundColor ="#FF9900"?

or are symbols created using a static string?

this.shape_1.graphics.f("#00FFFF").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwABQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");

It would be nice if I could the name of the symbol.

Thank you,

Charles

    This topic has been closed for replies.
    Correct answer kglad

    it's not efficient but you can use the filters property of you symbol to assign a color filter:

    this.hot_btn2.filters=[new createjs.ColorFilter(0,0,0,1,0,0,255,0)];

    this.hot_btn2.cache(0,0,this_etc.nominalBounds.width,this_etc.nominalBounds.height);

    better would be to create a movieclip button and use multiple frames on its timeline to display the various colors you want and use gotoAndStop in your code to control which frame/color is displayed.

    1 reply

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    October 31, 2017

    it's not efficient but you can use the filters property of you symbol to assign a color filter:

    this.hot_btn2.filters=[new createjs.ColorFilter(0,0,0,1,0,0,255,0)];

    this.hot_btn2.cache(0,0,this_etc.nominalBounds.width,this_etc.nominalBounds.height);

    better would be to create a movieclip button and use multiple frames on its timeline to display the various colors you want and use gotoAndStop in your code to control which frame/color is displayed.