ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var dist = 4;
var lastPressed;
var wantSize = 300;
clip1._x = 40;
this.onEnterFrame = function() {
for (i=2; i<4; i++) {
var mc = this["clip"+i];
var prev = this["clip"+(i-1)];
mc._x = prev._x+prev._width+dist;
trace(this["clip"+(i-1)]);
}
};
for (i=1; i<4; i++) {
//this["clip"+i]._x = mc._x+mc._width+dist;
var mc = this["clip"+i];
mc.onPress = function() {
if (lastPressed != this) {
t = new Tween(this, "_xscale", Elastic.easeOut, this._xscale, wantSize, 3, true);
t2 = new Tween(lastPressed, "_xscale", Elastic.easeOut, wantSize, 100, 3, true);
lastPressed = this;
}
};
}