all groups > flash actionscript > july 2006 >
You're in the

flash actionscript

group:

Horizontal Menu with Vertical y axis too



Horizontal Menu with Vertical y axis too yevri
7/21/2006 11:35:15 PM
flash actionscript: Hi,

I have a horizontal menu that is working great except for two things:

1. I want to make it scroll slowly when users don't have their cursor over it
or vertically near it, but faster when they get near it vertically or the
cursor is over the object. So I'm thinking if I use the _y property that would
work.

2. The graphic that is being scrolled horizontally gets a little wobbly in the
spot that is the 0 point (x and y) of the movieclip. As it slides slowly, it
wobbles like it is slow to redraw.

The script for the object is below. Everything works except the if then
statement with the _y and speed info near the bottom. The menu is positioned at
x=-50 and y=460 and it is 3155 pixels wide x 102 pixels tall.

Thanks!

onClipEvent (load)
{
xcenter=400;
speed=1/200;

}
onClipEvent (enterFrame)
{
var distance=xcenter-_root._xmouse;
_x+=(distance*speed);
if (_x > 0) _x=-1550;
if (_x < -1550) _x=0;
if (_y < 200) speed=1/200;
else
speed=1/80;
}
Re: Horizontal Menu with Vertical y axis too kglad
7/21/2006 11:52:24 PM
Re: Horizontal Menu with Vertical y axis too kglad
7/22/2006 12:00:00 AM
your variable (speed) should change depending upon the mouse's _y property. but it's changing relative to the movieclip.

Re: Horizontal Menu with Vertical y axis too yevri
7/22/2006 4:26:27 AM
That makes sense. So I thought maybe this following script would work, but it
doesn't. Any ideas?

onClipEvent (load)
{
xcenter=400;
speed=1/200;

}
onClipEvent (enterFrame)
{
var distance=xcenter-_root._xmouse;
_x+=(distance*speed);
if (_x > 0) _x=-1550;
if (_x < -1550) _x=0;
if (_ymouse < 450) speed=1/200;
else
speed=1/80;
}
Re: Horizontal Menu with Vertical y axis too yevri
7/25/2006 2:20:12 PM
Re: Horizontal Menu with Vertical y axis too kglad
7/25/2006 3:23:09 PM
AddThis Social Bookmark Button