PDA

View Full Version : Good Menu I want to Modify?


devil78inc
10-01-2002, 05:20 PM
Hi all (again),

there's a great little menu here

http://www.ultrashock.com/cgi-bin/flas/jump2.cgi?ID=165

that i want to emulate - it basically makes a clip shake all the time, and it grows when mouseover-ed

I want to make the shake effect happen when the mouse is over and get the elastic-y effect once the user has interacted,

what i want to know is if i modify the following code so that it is within a button instance on the mc and create a loop would this do the effect i'm after?

onClipEvent (enterFrame) {
// encima -- variable
tit = 0;
for (i=1; i<=num; i++) {
d = this["c"+i];
// checar
if (d.encima) {
s = 180;
_parent.tit.tit = "item"+i;
} else {
s = 100;
tit++;
}
// mov randome
difX = (d.xF-d._x);
difY = (d.yF-d._y);
if (difX<3 || difX>-3) {
g(d);
}
d._x += difX/10;
d._y += difY/10;
d._xscale += (s-d._xscale)/5;
d._yscale += (s-d._yscale)/5;
}
if (tit != num) {
_parent.tit._visible = true;
_parent.tit._x = _parent._xmouse;
_parent.tit._y = _parent._ymouse;
} else {
_parent.tit._visible = false;
}
}


if you can shed any light i'd be very grateful
thanks in anticipation
Amir

vosgien
10-02-2002, 10:59 PM
Hi,
Just posted a file in a thread called "dangling effect"(in this forum) it will give you the bounce effect in that menuSystem, you should be able to animate the clip inside to give you the shaking effect

Hope it helps

Vosgien

devil78inc
10-03-2002, 09:11 AM
Thanks for that Vosgien, you've nicely commented your code too - very good practice (which i should start doing a bit better too):D

vosgien
10-03-2002, 01:42 PM
Hi,
Glad it helped, but I said in the thread that I originally posted ( and I'll say it here too - so no one gets the wrong idea), the code is not original, it came from this site some time ago in response to a Q. I asked about inertia, I have changed it significantly and added ( and subtracted ) from the comments as needs be. I'm sure it looks nothing like the original code, but I will not take any credit for others hard work.
Anyways I hope it does what you need

Cheers

Vosgien