A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Button to control UIScrollbar scrolling?

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    21

    resolved [RESOLVED] Button to control UIScrollbar scrolling?

    I am using Flash CS3 and Action Script 2.0
    I have created a test file. See Attached


    I am looking for AS to control a scrollbar with a button. Jump to headline location.

    First, I have 3 buttons. Red, Blue and Yellow.
    Second, I have a scrollbar window with text in it. The scrollbar moves to any part of the text. The first paragraph is for the Red text, the second for the Blue text and third is Yellow text.

    When you click on the "Red" button the scrollbar should move to the RED TEXT headline. When you click on the "Blue" button it should move to the BLUE TEXT headline. And the same for the Yellow.

    Action Script, or a link to a tutorial would be great.

    Thank in advance for any help you can provide.
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    1,017
    Name your button instances btnBlue, btnRed and buttonYellow and put this code on the first frame of the main timeline:

    btnRed.onRelease = function() {
    textbox.scroll=0;
    }
    btnBlue.onRelease = function() {
    textbox.scroll=12;
    }
    btnYellow.onRelease = function() {
    textbox.scroll=23;
    }
    while (2+2 == 4) {
    drink ("bourbon");
    }
    gotoAndStop("bed");

  3. #3
    Junior Member
    Join Date
    Dec 2008
    Posts
    21
    That works perfect!!!!!
    Thank you for your help. : )


    --Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center