Hi there…
just need help with gradually attach mc one by one into stage then get bounce…
Ok what I have so far is I just attach the all the total mc simultaneously…so how’s to attach one by one then get bounce…
here’s the code…
springSpeed = .9;
springDamp = .6;
xscale = 120;
yscale = 120;
function bounce() {
var diffX = this.targetScaleX-this._xscale;
var diffY = this.targetScaleY-this._yscale;
this.vx += diffX*springSpeed;
this.vy += diffY*springSpeed;
this.vx *= springDamp;
this.vy *= springDamp;
this._xscale += this.vx;
this._yscale += this.vy;
if (Math.abs(diffX)<1 && Math.abs(diffY)<1 && Math.abs(this.vx)<.1) {
delete this.onEnterFrame;
//trace('stop');
}
};
MovieClip.prototype.getBounce = function(xscale, yscale) {
this.vx = 0;
this.vy = 0;
this.targetScaleX = xscale;
this.targetScaleY = yscale;
this.onEnterFrame = bounce;
};
nrTotal = 5;
for(var i=0;i<nrTotal;i++){
var theBox = _root.attachMovie("box","boxx"+i,99+i);
theBox._x = 50;
theBox._y = 50+i*(theBox._width+20);
theBox.getBounce(xscale, yscale);
}
tq