Vertical infinite menu

i checked the infinite menu as described in the tutorial - great, but i definitely need this menu working vertically.

did anyone succeed in changing the source code to get it work vertically? as i am more a designer than a programmer, i did not.
please help…

where it says _x or _xmouse change it to _y or _ymouse.

You want to manipulate the vertical (Y values) not the horizontal (X values) :slight_smile:

i did that, see code below…
this did not work. bad.

onClipEvent (load)
{
ycenter=150;
speed=1/10;
}
onClipEvent (enterFrame)
{
var distance=_root.ymouse-ycenter;
_y+=(distance*speed);
if (_y > 0) _y=-300;
if (_y < -300) _y=0;
}

is there any other code hidden in the file than the one to be typed in?

Well it looks fine to me… all except this one line

var distance=_root.ymouse-ycenter;

Its _root._ymouse not _root.ymouse. That underscore makes all the difference. That is probably your problem.

you should also reconsider the dimensions that the menu will go back to the beginning according to your movie’s height.

It looks about right to me. If the movie is 300 px tall the ycenter will be 150 and the ending point will be -300 before it is sent back to 0.

ok

but i assumed using the same dimensions as the first, since there are nothing told about the movie dimensions

That’s all

:hair:

thank you, i got it to work now.

beside the error in the code, i did also apply the actionscript to frame 1 of the scene and not to the instance of the movie clip (menu_general). the menu only works right, when the script is applied to the instance of the movie clip (menu_general).

well, it works now, going to put into my site and post the result in the forums later.

enjoy the weekend, there is more to do than sitting in front of our computers, even if it’s a mac… :slight_smile:

Yes… there is always more to do :slight_smile:

ANd Congrats :slight_smile:

well, hav a look at the vertical infinite menu and comment, please:

www.ockert-partner.com : releases : exhibitions : behisch, behnisch & partner _aedes east berlin 2002

the site is under development, currently fixing design strategies…

Neato :slight_smile: Nice to see it part of a “real” project.

looks good!

:tie:

Definitely neato. Good usage of it.

well, thanx,
next step will be to get the buttons work and load bigger views into the view area on the left of the menu.

don’t know yet how to solve that, its my first flash project, but with your help… seems to be no problem. :slight_smile:

you’re welcome to post the fla file here if you have specific questions. getting the buttons to work shouldn’t be too difficult =)

good luck

back again, i wanted to let the infinite menu only work, if the mouse is located in the strip of the menu. i achieved that to work for the x-direction, but can’t get it work in the other (y) direction.
here’s the code i use:

onClipEvent (load)
{
ycenter=130;
speed=1/10;
}
onClipEvent (enterFrame)
{
var distance=_root._ymouse-ycenter;
if (_xmouse > -31 and _xmouse < 31) _y+=(distance*speed);
if (_y > 0) _y=-246;
if (_y < -246) _y=0;
}

that means, the vertical menui is 62px wide and the it reacts only when the mouse crosses the 62 px wide strip. but, the visible area of the menu is only 180 px high (y-direction) and i want to tell the menu only to react when the mouse is within the 180 x 62 px area.

i tried to do it this way:

onClipEvent (enterFrame)
{
var distance=_root._ymouse-ycenter;
if (_xmouse > -31 and _xmouse < 31 and _ymouse > 40 and _ymouse < 220) _y+=(distance*speed);
if (_y > 0) _y=-246;
if (_y < -246) _y=0;
}

but this does not work.
any ideas?

by the way:
war is not the answer!

with a friendly hello from stuttgart

change -246 to just 246. Flash is arse backwards on the Y coordinates. The bottom is +y and the top is -y.

So consider the upper left corner of your movie of being at (0,0) :slight_smile:

is it possible to combine 4 “and” in one “if…” line as typed above?

Yes you can… you can use “and” or “&&”, but why not just use hitTest instead?

onClipEvent (load) {
	ycenter = 150;
	speed = 1/10;
}
onClipEvent (enterFrame) {
	var distance = _root._ymouse-ycenter;
	if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
		_y += (distance*speed);
	}
	if (_y>0) {
		_y = -246;
	}
	if (_y<-246) {
		_y = 0;
	}
}

It says that if both the xmouse and the ymouse are hovering over the movie clip, then do the following.

if i had known that a hitTest-command would exist, i probably had used it, thank you for opening my eyes!

i tried your code, but the area where the infinite menu reacts on the mouse position was bigger than the visible area of the movie clip.

i use now the following code, and it works.

onClipEvent (load)
{
ycenter=130;
speed=1/10;
}
onClipEvent (enterFrame)
{
var distance=_root._ymouse-ycenter;
if (_xmouse > -31 and _xmouse < 31 and _root._ymouse > 40 and _root._ymouse < 220) _y+=(distance*speed);
if (_y > 0) _y=-246;
if (_y < -246) _y=0;
}

thank you for your help… i will certainly return with other stupid questions.