View Full Version : How to do this menu effect
cool blue
June 21st, 2003, 01:57 AM
HI!!
just check this site.....the menu is too good....its kind of eleastic property
manually its possible, how do i make it through action Script
I just want ur help cos iam not good at Action script
the site is
http://www.lookandfeel.com/
thankx
:thumb: :crazy:
lostinbeta
June 21st, 2003, 02:14 AM
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=8673
^point in right direction... (of course xscale and yscale should be changed to _x and _y, or just remove all _x traces since you won't be moving that way)
cool blue
June 21st, 2003, 04:18 AM
no not working....
can u explain me a bit further
THANKX A MILLION
lostinbeta
June 21st, 2003, 11:49 AM
Put this on a frame...
//elastic function (created by Senocular)
MovieClip.prototype.elasticMove = function(targt, accel, friction) {
this.speed += (targt - this._y) * accel;
this.speed *= friction;
this._y += this.speed;
}
//set the original position, you can do this using the first menu drop down
//since all of them should be at the same position starting off
var origY = menuItem1InstanceName._y
//target one of your menu item clips and add an onEnterFrame handler
menuItem1InstanceName.onEnterFrame = function() {
//use hitTest to detect if mouse is over clip
if (this.hitTest(_root._xmouse, _root._ymouse, true)){
//spring to new position
this.elasticMove(positionToSpringTo, .5, .6);
} else {
//else spring back to the original location when mouse is off
this.elasticMovie(origY, .5, .6);
}
};
Now create your drop menu frame and convert it into a movie clip symbol. I recommend setting your registration point in the top center for this, it would make for easier calculations for positioning. After that give it an instance name then double click your symbol and add your menu items inside (buttons or whatever)
beanpie
March 29th, 2004, 09:31 AM
Was just surfing around a little bit in here and came across this thread, decided to give it a go.
Can't make it work though - should they both be "elasticMove" or is it correct that one is "elastic Movie"?
Is that my problem or am I not calling this correctly?
(AS is on the main timeline, not on the movieclip).
I just think it's cool and love little elastic things, so any help would be great.
Thanks!
-B
beanpie
March 29th, 2004, 09:54 AM
OK, so I've got it working a little bit better, only when I press the button to load a movie clip, my elasticity dissappears! Why oh why does this happen?
How do I get it to reset back to the beginning on press?
Thanks!
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.