0 Replies Latest reply on Aug 15, 2007 3:02 AM by Lucas Dobbins

    Action Script Help

    Lucas Dobbins
      Im trying to reverse the code below so a navigation bar will drop down from the top of the screen when rolled over and roll up when the cursor is taken off. At the moment the code is made so the navigation bar sits at the bottom and when rolled over will move up the screen and when the cursor is taken off disappears again.

      I have tried a couple thing to reverse the code like change the 'var topY = this._y-40' to 'var bottomY = this._y+40' but the nav bar will drop down once the movie play and when you rollover it will disappear up.

      // When this movieClip loads
      onClipEvent (load) {
      //variables for scrolling the button menu
      // declare a variable called increment and set its value to 0.01
      // declare a variable called speed
      var increment = 0.02;
      var speed;
      // variables fo showing and hiding menu MC
      var bottomY = this._y;
      var topY = this._y-40;
      var moveMenuFlag = false;
      var moveMenuDir = "down";
      var menuShowIncrement = 2;
      }
      onClipEvent (enterFrame) {
      // statements to show and hide the menu movieclip
      if (this.hitTest(_root._xmouse, _root._ymouse)) {
      if (moveMenuFlag == false) {
      moveMenuFlag = true;
      moveMenuDir = "up";
      }
      } else {
      moveMenuFlag = true;
      moveMenuDir = "down";
      }
      if (moveMenuFlag == true) {
      if (moveMenuDir == "up") {
      if (this._y>this.topY) {
      this._y -= menuShowIncrement;
      } else {
      moveMenuFlag = false;
      }
      }
      if (moveMenuDir == "down") {
      if (this._y<this.bottomY) {
      this._y += menuShowIncrement;
      } else {
      moveMenuFlag = false;
      }
      }
      }
      }