I have a wide rectangular MC that goes offscreen (verrrrrry wide) and i have this code on it:
onClipEvent (load)
{
xcenter=150;
speed=1/10;
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
}
(looks familiar? Its part of the code for the infinite menu).
Now I need the MC to stop moving when it reaches either end. I’ve tried If statements but that seems to halt the whole process altogether. I know Im missing something but i, for the life of me, cant seem to see it.
Any help on this, folks?