2 Replies Latest reply on Apr 6, 2009 12:03 AM by SwapnilVJ

    AS3 Custom Scrollable Movieclip Using Buttons

    DanEdmonds Level 1

      I am a student that is new to AS3 (although I have some experience with AS2) and new to the Adobe forums.

      I found, what I think is, a great tutorial on how to create a custom scroll bar without using the UI components. Unfortunately, the author has deleted the video but still provides the source files which I have began to pick apart. Although this scroll bar works great, I am working on a movieclip of scrollable thumbnails that only uses buttons to scroll and not the scrollbar it self. Please correct me if I am wrong, but it seems as though the buttons control the movie clip based on the position of the scroll bar/scroller.

      Here is the url of the tutorial page (the source files can be downloaded): http://www.developphp.com/Flash_tuts/AS3_scrollbar2.php
      I have also attached the code that is used to control the scrollbar.

      Can someone please provide the code that would only use the buttons to smoothly control the timeline? Or show some altercations of the code that would make this work properly. I've seen it done in AS2 without much of a problem but I am not very good at translating AS2 to AS3.
        • 1. Re: AS3 Custom Scrollable Movieclip Using Buttons
          kglad Adobe Community Professional & MVP

          i didn't check any of your links but to scroll a movieclip smoothly, you would do better to control the movieclip's x (or y) property, and not its timeline.

          • 2. Re: AS3 Custom Scrollable Movieclip Using Buttons
            SwapnilVJ Level 4

            You can use a ScrollPane component and customize its look and feel.

            Why you are trying to re-invent the wheel?

            Use ScrollPane component and just customize its look and feel.


            What I would have done in this case is

            1. Take a ScrollPane.

            2. Set its horizontalScrollPolicy ="Off"; and verticalScrollPolicy ="Off".

            3.Change the Look and feel for background.

            4. Create buttons on stage and write the following code on click event of those buttons.




            function moveRight(evnt:MouseEvent)


                 myScrollPane.horizontalScrollPosition = myScrollPane.horizontalScrollPosition + myScrollPane.width;

                 //You can use a Tween effect here for better User Experience.