apple_x
February 21, 2003, 6:29pm
1
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…
system
February 21, 2003, 6:30pm
2
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)
system
February 21, 2003, 6:37pm
3
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?
system
February 21, 2003, 7:01pm
4
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.
system
February 21, 2003, 7:04pm
5
you should also reconsider the dimensions that the menu will go back to the beginning according to your movie’s height.
system
February 21, 2003, 7:11pm
6
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.
system
February 21, 2003, 7:17pm
7
ok
but i assumed using the same dimensions as the first, since there are nothing told about the movie dimensions
That’s all
:hair:
system
February 22, 2003, 6:23pm
8
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…
system
February 22, 2003, 6:28pm
9
Yes… there is always more to do
ANd Congrats
system
February 24, 2003, 11:59am
10
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…
system
February 24, 2003, 2:12pm
11
Neato Nice to see it part of a “real” project.
system
February 24, 2003, 5:48pm
13
Definitely neato. Good usage of it.
system
February 24, 2003, 6:15pm
14
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.
system
February 24, 2003, 7:56pm
15
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
system
February 26, 2003, 6:21pm
16
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
system
February 26, 2003, 6:26pm
17
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)
system
February 26, 2003, 6:35pm
18
is it possible to combine 4 “and” in one “if…” line as typed above?
system
February 26, 2003, 7:03pm
19
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.
system
February 27, 2003, 8:34am
20
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.