Listing B
onClipEvent (load) {
       var hidden = true;
       var speed = 3;
       var oXPos = 0;
       var newXPos = _x;
       var myXspeed  = 0;
       function hideMenu() {
              if (!hidden) {
                     newXPos = -180;
                     hidden = true;
                     mouseCounter  = 0;
              }
       }
       function showMenu() {
              newXPos = oXPos;
              hidden = false;
       }
       showMenu();
}

onClipEvent (enterFrame) {
       myXspeed = (_x-newXPos)/speed;
       _x -= myXspeed;
      
       if (mouseCounter>=220 && !hidden) {
              hideMenu();
       }
      
       mouseCounter++;
}

onClipEvent (mouseMove) {
       var mousepos = _root._xmouse;
       _root.menuMove(mousepos);
}