1 Reply Latest reply on Oct 21, 2009 2:59 PM by kglad

    help with auto scrolling feature

    marknestor

      So I have this movieclip setup so that when you rollover it it activates a scrolling feature where the clip (just text really) moves up and down with the location of your mouse so you don't need to use a scroll bar to scroll.

       

      Problem is it continues to scroll even when you're not over the clip - really annoying. Could anyone help me with this script? See below:

       

       

      panel.onRollOver = panelOver;

       

      function panelOver() {

      this.onEnterFrame = scrollPanel;

      delete this.onRollOver;

      }

       

      var b = stroke.getBounds(_root);

       

      function scrollPanel() {

      if(_ymouse<b.xMin || _ymouse>b.yMax) {

      this.onRollOver = panelOver;

      delete this.onEnterFrame;

      }

       

      if(panel._y >= 25) {

      panel._y = 25;

      }

       

      if(panel._y <= -295) {

      panel._y = -295;

      }

       

      var ydist = _ymouse - 150;

       

      panel._y += Math.round(-ydist / 20);

      }

        • 1. Re: help with auto scrolling feature
          kglad Adobe Community Professional & MVP

           

           

           

          panel.onRollOver = function {

          this.onEnterFrame = scrollPanel;

          }

          panel.onRollOut = function {

          delete this.onEnterFrame;

          }

           

          function scrollPanel() {


           

          var ydist = _ymouse - 150;

           

          panel._y += Math.round(-ydist / 20);


           

          if(panel._y >= 25) {

          panel._y = 25;

          }

           

          if(panel._y <= -295) {

          panel._y = -295;

          }

          }