Copy link to clipboard
Copied
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("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwABQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");
exportRoot.hotbtn_2.shape_1.graphics.f("#FF9900").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwABQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");
exportRoot.hotbtn_2a.shape_1.graphics.f("#FF9900").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwABQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");
exportRoot.hotbtn_2b.shape_1.graphics.f("#FF9900").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwABQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");
break;
case " 3":
exportRoot.hotbtn_2.shape_1.graphics.f("#00FFFF").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwABQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");
exportRoot.hotbtn_2a.shape_1.graphics.f("#00FFFF").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwABQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");
exportRoot.hotbtn_3.shape_1.graphics.f("#FF9900").s().p("AhSBTQgjgiAAgxQAAgvAjgjQAigjAwABQAwgBAjAjQAjAjgBAvQABAxgjAiQgjAjgwAAQgwAAgigjg");
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
yes, you can:
exportRoot['button string'][shape string']
Copy link to clipboard
Copied
Thank you so much that is what i was looking for
Copy link to clipboard
Copied
the syntax is what kills me the most
Copy link to clipboard
Copied
is there an api that shows that?
eg, checking easeljs, i don't see a shape property of movieclips:
Copy link to clipboard
Copied
i'm using html5/canvas so when you go look at the javascript adobe creates it like this.
exportRoot.mysymbol.shape_1.graphics.f("#FF9900").s().p("AhCBDQgcgcAAgnQAAgmAcgcQAcgcAmAAQAnAAAcAcQAcAcAAAmQAAAngcAcQgcAcgnAAQgmAAgcgcg")
i knew there was a fill property i was just not using it right
this was the way i was trying to look for because i didn't want that long string
exportRoot.mySymbol.shape.graphics._fill.style = "#FF9900"; //changes its color to blue.