PDA

View Full Version : Actionscripted falling physics..on rollover



[uber]
April 2nd, 2005, 06:20 PM
I need to animate little blocks to fall down when rollovered... but i want them to start falling and keep falling once mouse hittests with it... so when the mouse isn't over the clip... it keeps falling... does anyone know how i can do this? and if anyone knows some good actionscript for elastic falling with slight rotation that would be sweet....


-[uber]

frost_oni
April 2nd, 2005, 06:44 PM
make a mc called block [ or modify accordingly ], and put this code in a main stage frame. this is just the building block, but i trust that you have the knowledge to expand this. :)



fall = function (obj, speed) {
obj._y += (obj._y-234)/speed;
obj._rotation++;
};
block.onRollOver = function() {
block.onEnterFrame = function() {
fall(this, 10);
};
};

frost_oni
April 2nd, 2005, 06:46 PM
on other thoughts....

[uber]
April 2nd, 2005, 06:51 PM
you are so sexy.... i had something like what you had going... but i was missing the point

frost_oni
April 2nd, 2005, 06:52 PM
:battery:

frost_oni
April 2nd, 2005, 07:11 PM
here's a proper one.