I have a piece of code that uses AS to tween movieclips around the stage…see below:
tweenspeed = 50;
mc1 = _root[trans];
y1 = _root[trans]._y;
x1 = _root[trans]._x;
go_y1 = _root.point1._y;
go_x1 = _root.point1._x;
Tween_y1 = new mx.transitions.Tween(mc1, "_y", easeType, y1, go_y1, tweenspeed);
Tween_x1 = new mx.transitions.Tween(mc1, "_x", easeType, x1, go_x1, tweenspeed);
If I have 20 ball mc’s each called ball1, ball2, ball3 etc…I would need to run this script through a loop adding 1 the end of ball each time the loop runs.
I think I’ve made it ok but it doesnt work…could someone check through the 2nd bit of code and tell me what I’m doin wrong…its most likey to do with the * bits.
Anyway here it is…
function ballTween() {
tweenspeed = 50;
trans = [];
mc = [];
y = [];
x = [];
go_y = [];
go_x = [];
Tween_y = [];
Tween_x = [];
team = [];
point = [];
for (i=1; i<51; i++) {
trans* = (team*);//team is a variable
mc* = _root[trans+i];
y* = _root[trans+i]._y;
x* = _root[trans+i]._x;
go_y* = _root.point*._y;
go_x* = _root.point*._x;
Tween_y* = new mx.transitions.Tween(mc*, "_y", easeType, y*, go_y*, tweenspeed);
Tween_x* = new mx.transitions.Tween(mc*, "_x", easeType, x*, go_x*, tweenspeed);
}
}