5 Replies Latest reply on May 22, 2006 7:30 AM by exPluda?

    Deadline: 22 May 08H00 Help ME Please Scrolling a movie clip from the Centre

    spaceimpact
      Hi

      It has been a while since I have been here I am in need for some serious help, I am so frustrated.

      What I want to do is pretty simple, I am building a DJ website and the navigation is a pitch controller, similar to what they have on a mixing board anyway, when you drag the pitch controller I need the movie clip symbol to scroll either up and down, so technically the pitch controller will have to start from the center, but I have no idea what I am doing.

      I have been going through tutorials for 15 hours but all they show you is how to create a normal scroller that starts at the top and srolls down. I am in desprite need as I have a deadline to meet for tomorrow morning. HELP

        • 1. Re: Deadline: 22 May 08H00 Help ME Please Scrolling a movie clip from the Centre
          tonyhigham
          this should be pretty simple to accomplish, but it's hard to help without some code
          • 2. Re: Deadline: 22 May 08H00 Help ME Please Scrolling a movie clip from the Centre
            spaceimpact Level 1
            ok this is the code I got from a tutorial that i was woking from, but I dont really understand it in detail what I do know is I dont need the arror buttons in this code becuase all I need is a the scroller.

            scrolling = function () {
            var scrollHeight:Number = scrollTrack._height;
            var contentHeight:Number = contentMain._height;
            var scrollFaceHeight:Number = scrollFace._height;
            var maskHeight:Number = maskedView._height;
            var initPosition:Number = scrollFace._y=scrollTrack._y;
            var initContentPos:Number = contentMain._y;
            var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
            var left:Number = scrollTrack._x;
            var top:Number = scrollTrack._y;
            var right:Number = scrollTrack._x;
            var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y;
            var dy:Number = 0;
            var speed:Number = 10;
            var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);

            scrollFace.onPress = function() {
            var currPos:Number = this._y;
            startDrag(this, false, left, top, right, bottom);
            this.onMouseMove = function() {
            dy = Math.abs(initPosition-this._y);
            contentMain._y = Math.round(dy*-1*moveVal+initContentPos);
            };
            };
            scrollFace.onMouseUp = function() {
            stopDrag();
            delete this.onMouseMove;
            };
            btnUp.onPress = function() {
            this.onEnterFrame = function() {
            if (contentMain._y+speed<maskedView._y) {
            if (scrollFace._y<=top) {
            scrollFace._y = top;
            } else {
            scrollFace._y -= speed/moveVal;
            }
            contentMain._y += speed;
            } else {
            scrollFace._y = top;
            contentMain._y = maskedView._y;
            delete this.onEnterFrame;
            }
            };
            };
            btnUp.onDragOut = function() {
            delete this.onEnterFrame;
            };
            btnUp.onRelease = function() {
            delete this.onEnterFrame;
            };
            btnDown.onPress = function() {
            this.onEnterFrame = function() {
            if (contentMain._y-speed>finalContentPos) {
            if (scrollFace._y>=bottom) {
            scrollFace._y = bottom;
            } else {
            scrollFace._y += speed/moveVal;
            }
            contentMain._y -= speed;
            } else {
            scrollFace._y = bottom;
            contentMain._y = finalContentPos;
            delete this.onEnterFrame;
            }
            };
            };
            btnDown.onRelease = function() {
            delete this.onEnterFrame;
            };
            btnDown.onDragOut = function() {
            delete this.onEnterFrame;
            };

            if (contentHeight<maskHeight) {
            scrollFace._visible = false;
            btnUp.enabled = false;
            btnDown.enabled = false;
            } else {
            scrollFace._visible = true;
            btnUp.enabled = true;
            btnDown.enabled = true;
            }
            };
            scrolling();
            • 3. Deadline: 22 May 08H00 Help ME Please Scrolling a movie clip from the Centre
              injpix Level 3
              If you don’t need the arrow buttons simply delete the btnDown and btnUP functions. Also delete the btnDown and btnUP properties that are in the last conditional statement.
              • 4. Re: Deadline: 22 May 08H00 Help ME Please Scrolling a movie clip from the Centre
                spaceimpact Level 1
                OK I will do that, but thats not the problem the problem is that I need this scrolller to start from th centre and be able to scroll the movie clip up or down, currently the scroller starts at the top and you can acroll down. any suggestions?
                • 5. Re: Deadline: 22 May 08H00 Help ME Please Scrolling a movie clip from the Centre
                  exPluda? Level 1
                  hello,

                  I think you just need to change this:

                  var initPosition:Number = scrollFace._y=scrollTrack._y;

                  to this

                  var initPosition:Number = scrollFace._y/2;
                  var scrolltrack_y:Number = initPosition;

                  and then change scrolltrack._y to scrolltrack_y