OK I’m still having problems with this scrolling menu. [Tut]
It seems to work ok until you move the mouse to the left. Then it stops when it gets to the first frame.
The code is:
onClipEvent (load)
{
xcenter=389.9;
speed=1/10;
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x-=(distance*speed);
if (_x > 0) _x=-1768.6;
if (_x < -1768.6) _x=0;
}
I have supplied the fla if it helps.
As always, I don’t want anyone to do it for me. I would just like to know what I’m doing wrong.
I have about 30 of these to do so I would like to be able to them myself and not have to keep posting when things go pear shaped.
#1 there was a bit of code missing from the middle…
[AS]onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
}[/AS]
so i added that in, for the total code to be
[AS]
onClipEvent (load)
{
xcenter=389;
speed=1/50;
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x+=(distancespeed);
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x+=(distancespeed);
if (_x > 0) _x=-1772;
if (_x < -1772) _x=0;
}[/AS]
The only thing else in the code that I changed was the xcenter 339, the speed 50, and the last number(i think it was 1764.6 originally, dont remember).
let me explain why, but first, i will tell you the other big thing that you were missing. you needed to have a dup of the group of buttons inside the main MC; you only had one. it has to be there so that when it’s scrolling, and it needs to repeat, well, it can. this makes it continually scroll. so i just added a copy in.
now for the #s in AS, i changed 389 cuz i like whole #s, I changed 10 to 50 cuz it was going soo fast i was getting a headache, and i changed the last # to 1772 because when i added on the 2nd image, it needed a few extra pixels to account for half of the gap between the two images this way it was smooth, and didn’t jump. actually, it still jumps abotu 3 pixels or so, very minor, but i would suggest that you tweak it to match exactly, i jsut didnt wanan DO IT for you… lol
let me know if there’s anything i didnt explain good