2 Replies Latest reply on Jan 5, 2008 8:03 AM by robdillon

    Moving Movie clip with button

    Lord of Limbo
      Hello AS wizards everywhere. Can anyone help with this. I have a movie clip which displays a very long horizontal line of thumbnail movie clips which will eventually have actions attached. Right now, I'm trying to find a way of moving the long line to the left or right by 165 pixels. The movie clip I want to move has an instance name "scrollalong" and is part of a movie calIed "scroll thumb nails". I wish to do this with 2 buttons residing on the main timeline called "go left" and "go right". Once I've got to a certain point with the "scrollalong" clip I want to disable the button action so that it won't move.

      thank you from a frustrated musician Map of Limbo
        • 1. Re: Moving Movie clip with button
          kglad Adobe Community Professional & MVP
          increment (and decrement) the _x property of your scrollalong movieclip with the left (and right) button presses. you should give an instance name to your "scroll thumb nails" movieclip so you can logically reference scrollalong.
          • 2. Re: Moving Movie clip with button
            robdillon Most Valuable Participant
            You'll need to define the right limit point and the left limit point of the scrollalong clip. I'm guessing that the left limit point will be the starting point of the clip. And, that the right limit point will be 165 X the number of thumbnails in the clip.

            So you could use something like this from the main timeline:

            var leftLimit:Number = scrollThumbNails.scrollalong._x;
            var rightLimit:Number = leftLimit + (165 * number of clips);


            leftButton.onRelease = function() {

            if (scrollThumbNails.scrollalong._x > leftLimit) {
            scrollThumbNails.scrollalong._x -= 165;
            }
            }
            rightButton.onRelease = function() {
            if (scrollThumbNails.scrollalong._x < rightLimit) {
            scrollThumbNails.scrollalong._x += 165;
            }
            }