Apply and array...
- Started
- Last post
- 9 Responses
- hUtChhOuSe
Got this in a MC and was hoping it would apply a different colour each loop. It no worky tho. Anyone know why?
Xi = random(7);
//
ColourSelector = new Array();
ColourSelector[0] = 0xFFE500;
ColourSelector[1] = 0xB3A000;
ColourSelector[2] = 0xFFF9BF;
ColourSelector[3] = 0xFFF280;
ColourSelector[4] = 0xFFCC00;
ColourSelector[5] = 0xFFE680;
ColourSelector[6] = 0xFFF2BF;
ColourSelector[7] = 0xB38F00;
//
ColourSet = ColourSelector[Xi];
//
this.setRGB(ColourSet);
- bk_shankz0
is the this object a color object?
- hUtChhOuSe0
'this' was refering to the MC the code is in (first frame).
- rabattski0
well that's the problem then. can't really colourize an empty mc (empty as in it only holds as).
- hUtChhOuSe0
The MC has artwork on it...
- rabattski0
ok. what do you get when you trace colourset?
- bk_shankz0
myColor = new Color(this);
myColor.setRGB(rand);
- rabattski0
ow fuck yeah... that's like a big duuuuuuuh.... :)
- hUtChhOuSe0
Nice one bk_shankz!
That saved my bacon :o)
- bk_shankz0
no problem!