Need to make each button in this script have its own unique color? Anyone want to help me to achieve this?
The code;
import mx.transitions.Tween;
import mx.transitions.easing.*;
#include "lmc_tween.as"
function hitButton(btn) {
btn.onRollOver = function() {
this.colorTo (0x3366FF); }
btn.onRollOut = function() {
this.colorTo (0x000000); }
btn.onRelease = function() {
for (var i = 0; i<5; i++) {
_root["btn"+i].enabled = true;
}
flop(myPrevButton);
if (this._xscale>-50) {
this.enabled = false;
flip(this);
myPrevButton = this;
}
}
}
for (var i = 0; i<5; i++) {
_root.hitButton(_root["btn"+i]);
}
function flip(who) {
for (var i = 0; i<5; i++) {
who.colorTo (0x3366FF, 2); }
var twflip:Tween = new Tween(who, "_xscale", Bounce.easeOut, 100, -100, 1, true);
}
function flop(who) {
for (var i = 0; i<5; i++) {
who.colorTo (0x000000, 2); }
var twflop:Tween = new Tween(who, "_xscale", Bounce.easeOut, -100, 100, 2, true);
}