# Vertical infinite menu

**URL:** <https://forum.kirupa.com/t/vertical-infinite-menu/14081>\
**Category:** Uncategorized\
**Created:** [February 21, 2003, 6:29pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081 "2003-02-21T18:29:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![apple\_x](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@apple\_x](https://forum.kirupa.com/u/apple_x)\
**Post date:** [February 21, 2003, 6:29pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/1 "2003-02-21T18:29:10Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 21, 2003, 6:30pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/2 "2003-02-21T18:30:34Z")

</div>

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) 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 21, 2003, 6:37pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/3 "2003-02-21T18:37:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 21, 2003, 7:01pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/4 "2003-02-21T19:01:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 21, 2003, 7:04pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/5 "2003-02-21T19:04:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 21, 2003, 7:11pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/6 "2003-02-21T19:11:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 21, 2003, 7:17pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/7 "2003-02-21T19:17:26Z")

</div>

ok

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

That’s all

:hair:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 22, 2003, 6:23pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/8 "2003-02-22T18:23:43Z")

</div>

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… 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 22, 2003, 6:28pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/9 "2003-02-22T18:28:17Z")

</div>

Yes… there is always more to do 🙂

ANd Congrats 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 24, 2003, 11:59am UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/10 "2003-02-24T11:59:25Z")

</div>

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

[www.ockert-partner.com](http://www.ockert-partner.com) : releases : exhibitions : behisch, behnisch & partner \_aedes east berlin 2002

the site is under development, currently fixing design strategies…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 24, 2003, 2:12pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/11 "2003-02-24T14:12:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 24, 2003, 2:13pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/12 "2003-02-24T14:13:57Z")

</div>

looks good!

:tie:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 24, 2003, 5:48pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/13 "2003-02-24T17:48:03Z")

</div>

Definitely neato. Good usage of it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 24, 2003, 6:15pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/14 "2003-02-24T18:15:25Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 24, 2003, 7:56pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/15 "2003-02-24T19:56:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2003, 6:21pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/16 "2003-02-26T18:21:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2003, 6:26pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/17 "2003-02-26T18:26:10Z")

</div>

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) 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2003, 6:35pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/18 "2003-02-26T18:35:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 26, 2003, 7:03pm UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/19 "2003-02-26T19:03:09Z")

</div>

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

```php
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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 27, 2003, 8:34am UTC](https://forum.kirupa.com/t/vertical-infinite-menu/14081/20 "2003-02-27T08:34:49Z")

</div>

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.

[Next page](https://forum.kirupa.com/t/vertical-infinite-menu/14081.md?page=2)
