PDA

View Full Version : Bouncing size



newbie22
September 20th, 2002, 09:55 AM
Hi guys!

I was thinking on how to make a dinamic scalalable Mc with some kind of bouncing... Come on! we all have seen this somewhere, but I´m new in Actionscript, so I bet I could do it with a llitle help from my friends:P

I would like to trigger the new size from a button, I hope this helps!

andr.in
September 20th, 2002, 03:41 PM
what kinda bouncing?
something like my footer? (drag the circle)

pom
September 20th, 2002, 03:44 PM
If you have a clip called square on the scene, you can try this code on the first frame of the movie:
inertia=.6;
k=.2;
function elastic (val){
var ds=val-this._yscale;
this.speed=this.speed*inertia+ds*k;
this._xscale+=this.speed;
this._yscale+=this.speed;
}
square.onRollOver=function(){
this.onEnterFrame=function(){
elastic(150);
}
}
square.onRollOut=function(){
this.onEnterFrame=function(){
elastic(100);
}
}It's Flash MX by the way. But the principle is explained on the springs tutorial on this site.

pom :asian: