Hi there-
I using a for loop for a redundant action that I want to happen across 5 buttons. OnRollOver the button rotates. OnPress the button moves to a new position. It looks like this:
for(i=0;i<5;i++){
_root.swatch_mc['swatch'+i].onRollOver = function () {
this.onEnterFrame = function () {
this._rotation += (-2-this._rotation)/speed;
}
}
_root.swatch_mc['swatch'+i].onRollOut = function () {
this.onEnterFrame = function () {
this._rotation += (0-this._rotation)/speed;
}
}
_root.swatch_mc['swatch'+i].onPress = function () {
var selected = this;
this.enabled=false;
selected.onEnterFrame = function () {
this._y += (-100-this._y)/speed;
}
}
}
My problem is this; onPress I want the button to move up (Ive achieved this already). I also want the other buttons to move down onPress (this is my problem). Is there a way have the other 4 buttons move down onPress using the for loop? Or is there another method of doing this?
check out the example of what i have here http://acohido.com/pantonetest.swf
Thanks!!