Help me dumb down this code...
I'm finishing up a site for this guy, and I have this infinite menu that scrolls images slowly, and is also mouse dependant.
After all the work, and a lot of help from oldNewbie, the guy would now like to remove ALL mouse dependancy on the menu.
Basically, the menu just scrolls along slowly, and nothing changes if you mouse over.
This is the code right now:
onClipEvent (load) {
xcenter = 400;
speed = 1/10;
}
onClipEvent (enterFrame) {
if ((_root._xmouse > 20 && _root._xmouse < 780) && (_root._ymouse > 20 && _root._ymouse < 120)) {
var distance = _root._xmouse-xcenter;
_x -= Math.round(distance*speed);
if(_x < -1800){
_x = 0;
}
if(_x > 0){
_x = 1800;
}
}
else{
if(distance > 0)
{
_x +=4;
}
else{
_x -=4;
}
_x -= Math.round(distance*speed);
if(_x < -1800){
_x = 0;
}
if(_x > 0){
_x = -1800;
}
}
}
|