// The code below works fine the first time, then...
for (var i=0;i<4;i++) {
trace(prod_array+": "+Prod_Selected.indexOf(prod_array));
if (Prod_Selected.indexOf(prod_array) < 0) {
switch (i) {
case 0:
TweenMax.to(Object(root).eTrain, .5, {autoAlpha:0});
break;
case 1:
TweenMax.to(Object(root).eTrainer, .5, {autoAlpha:0, delay: .3});
break;
case 2:
TweenMax.to(Object(root).eTrain_Enterprise, .5, {autoAlpha:0, delay: .5});
break;
case 3:
TweenMax.to(Object(root).eTrain_Ent_Corp_Ed, .5, {autoAlpha:0, delay: .7});
break;
}
}
// I return these MC's to their starting positions and alpha with the following code (called in a function) This code does not work the way I expected. The tweens are not smooth at all:
eTrain.x = 2;
TweenMax.to(eTrain, .5, {autoAlpha:100, delay:.5});
eTrainer.x = 153.95;
TweenMax.to(eTrainer, .5, {autoAlpha:100, delay: .7});
eTrain_Enterprise.x = 298.25;
TweenMax.to(eTrain_Enterprise, .5, {autoAlpha:100, delay: .9});
eTrain_Ent_Corp_Ed.x = 422.60;
TweenMax.to(eTrain_Ent_Corp_Ed, .5, {autoAlpha:100, delay: 1.1});
// When I run the first part of code again, things do not run like the first time.