1 Reply Latest reply on Aug 23, 2007 1:59 AM by FandLR

    Scrolling a Movie Clip?

    Wissler
      I've created a scrolling Movie Clip using a mask and used a smooth scroll method to move that Movie Clip up and down from the mask.

      However my problem is that there is no height restriction for the scrolling. Meaning when you click either the up arrow or down arrow the movie clip will scroll beyond the content.

      Here's an example. Use the up and down arrows on the far right column under the News section.
      http://www.bighousegraphix.com/FTPfiles/bighouse/

      So my question is, in ActionScript is there a way to set a specific height so the movie clip will stop scrolling when it gets to the top of the content, same at the bottom?

      My code for the up and down buttons are as follows:

      onClipEvent (enterFrame) {
      if(isscrolling) {
      _parent.content_mc._y -=5;
      }

      Inside the buttons themselves I have this code:

      on (press) {
      isscrolling = true;
      }
      on (release) {
      isscrolling = false;
      }
      on (releaseOutside) {
      isscrolling = false;
      }

      }

      Any help would be greatly appreciated.

      Thanks.
        • 1. Re: Scrolling a Movie Clip?
          FandLR
          top = content_mc._y;
          bottom = content_mc._y - content_mc._height + mask_mc._height.
          onClipEvent (enterFrame) {
          if(isscrolling) {
          _parent.content_mc._y -=5;
          if(_parent.content_mc._y > top)
          {
          _parent.content_mc._y = top
          isscrolling = false
          }
          else if(_parent.content_mc._y < bottom)
          {
          _parent.content_mc._y = bottom
          isscrolling = false
          }

          }