Gürkan Pala
Gürkan Pala

Reputation: 233

as2 give background

I wanto to make set background color the mc.

1.mc-2.mc-3.mc-my_mc

This codes not show bacground.

var bg_colour:Color = new Color(1_mc.2_mc.3_mc.my_mc);
bg_colour.setRGB(0x6546a0);

This codes show color. but my work does not. How can I do this? Thanks for answers.

var bg_colour:Color = new Color(1_mc.2_mc);
bg_colour.setRGB(0x6546a0);

Upvotes: 0

Views: 358

Answers (2)

ʞᴉɯ
ʞᴉɯ

Reputation: 5594

Why are you using a number as instance name prefix? This is not reccomended in Flash actionscript (and in any programming language).

Use mc_1, mc_2 instead:

var bg_colour:Color = new Color(mc_1.mc_2);
bg_colour.setRGB(0x6546a0);

Upvotes: 1

Benny
Benny

Reputation: 2228

bg_colour = new Color("1_mc");
bg_colour.setRGB(0x6546a0);

Upvotes: 1

Related Questions