Hi.
I dont' know if this can be useful for someone, but I started to find solutions for the problems I had in October and I want to post them in case It can be helpful.
Using loops and arrays is simplifying a lot the code I am using. Instead of writng the same code over and over for each button I am doing this:
import com.greensock.*;
import com.greensock.easing.*;
//Initial status of Buttons and Mc's
TweenMax.to(MC1,0.1,{_alpha:100});
TweenMax.to(BT1, 0.1, {_alpha:0});
TweenMax.to(MCBolo1,0.1,{_alpha:100});
TweenMax.to(MCVara1,0.1,{_alpha:100});
BT1.enabled = false;
//Estado de los botones de interface. Buttons status
for (i = 0; i < 9; i++) {
this["BT" + i].onRelease = function(){
selec = Number(this._name.slice(2));
alfear();
};
}
function alfear() {
for (i = 0; i < 9; i++) {
TweenMax.to(this["MC"+i],0.3,{_alpha:0});
TweenMax.to(this["MCBolo"+i],0.3,{_alpha:0});
TweenMax.to(this["MCVara"+i],0.3,{_alpha:0});
TweenMax.to(this["BT" + i],0.3,{_alpha:100});
this["BT" + i].enabled = true;
}
this["BT" + selec].enabled = false;
TweenMax.to(this["MC" + selec],0.3,{_alpha:100});
TweenMax.to(this["MCBolo"+selec],0.3,{_alpha:100});
TweenMax.to(this["MCVara"+selec],0.3,{_alpha:100});
TweenMax.to(this["BT"+selec],0.3,{_alpha:0});
}
//Changing the size of circles and bars
A_escalar=new Array(0,125,121,113,110,92,106,95,93);
for (i = 0; i < 9; i++) {
TweenMax.to(this["MCBolo"+i],0.3,{_xscale:A_escalar[i], _yscale:A_escalar[i],ease:Quart.easeOut});
}
A_alargar=new Array(0,231,139,139,0,277,332,63,554);
for (i = 0; i < 9; i++) {
TweenMax.to(this["MCVara"+i],0.3,{_xscale:A_alargar[i],ease:Quart.easeOut});
}
This is not perfect, as can be seen in the .fla: I haven't been able to make it work for just one MCBolo and one MCVara, so I have to bear those ugly alpha transitions between MCBolo1 and 2 and so on, and between MCVara1 and 2 and so on.
And I haven't been able to use different values for duration. Even using different functions for the different tweenings it will always use the first it reads.
But it is better than it was just a month ago and I am working on it.
Hope it can help somebody. Thank you for your work,
Alejandro.