Hello,
I have a rising menu that when you roll your mouse over it, it rises and when you move your mouse away, it falls back down. (Thanks to Senocular’s code!)
Unfortunately, the problem I have is that if the menu rises and you happen to put your mouse near the bottom of the menu, the menu will be very touchy, rising and falling until you move it away.
I was wondering if the menu could be triggered to go down only if you rollover the same menu again. Or, that when you rolloff, it has to complete the rolloff before starting over? Is this the only way this problem could be solved?
This is the code:
//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;
}
var origY = menuItem1InstanceName._y
menuItem1InstanceName.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)){
this.elasticMove(positionToSpringTo, .5, .6);
} else {
this.elasticMovie(origY, .5, .6);
}
};
I’ll attach my file to this posting… Thanks!