×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    12

    How to create Scrollbar with action script 2.0?

    Hello,
    I need to create a simple scrollbar with action script 2.0
    Here is my code:
    this.onKeyDown = function()
    {

    switch (Key.getCode())
    {
    case Key.UP :
    testing1_txt.scroll--;
    break;
    case Key.DOWN :
    testing1_txt.scroll++;
    break;

    }
    };
    Key.addListener(this);

    var str:String;
    str = "Some texts"
    testing1_txt.htmlText = str;
    I want to add some codes to create scrollbar..
    Thanks in advance

  2. #2
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: How to create Scrollbar with action script 2.0?

    Hey,

    I have some examples of UI components for the community on my blog. Using those you will discover how to achieve scrolling in AS2 and AS1.

    http://flashmobileblog.com/examples/

    Mark
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    12

    Re: How to create Scrollbar with action script 2.0?

    Thanks Mark..
    Realy useful examples
    And i will try to write the code..

  4. #4
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: How to create Scrollbar with action script 2.0?

    Let us know how you got on, or if there are any bugs in the code :-)
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  5. #5
    Registered User
    Join Date
    Aug 2008
    Posts
    12

    Re: How to create Scrollbar with action script 2.0?

    Here is my code and it's work just fine but i have one problem
    I can't adjust the scorlling with the text scrolling up and down..

    var str:String;
    str = "<b>Some texts</b>"
    question1_txt.htmlText = str;
    this.onKeyDown = function()
    {

    switch (Key.getCode())
    {
    case Key.UP :
    question1_txt.scroll--;
    scrollAmt = (question1_txt.scroll-1)/question1_txt.maxscroll;
    scrollHeight = sb_mc.track_mc._height - sb_mc.thumb_mc._height
    sb_mc.thumb_mc._y = int(scrollHeight*scrollAmt);
    break;
    case Key.DOWN :
    question1_txt.scroll++;
    scrollAmt = (question1_txt.scroll-1)/question1_txt.maxscroll;
    scrollHeight = sb_mc.track_mc._height - sb_mc.thumb_mc._height
    sb_mc.thumb_mc._y = int(scrollHeight *scrollAmt);
    break;
    }
    };
    Key.addListener(this);
    sb_mc > scrollbar
    arrow_up_mc > arrow up
    arrow_down_mc > arrow down
    thumb_mc > thumb
    track_mc > track

  6. #6
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: How to create Scrollbar with action script 2.0?

    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

Similar Threads

  1. Problems installing Series40 DP 2.0. SDK 1.1
    By shokker in forum Series 40 & S60 Platform Feedback Archive
    Replies: 0
    Last Post: 2007-05-17, 18:58
  2. How to create ArrowHead scrollbar for Grid?
    By stevenhotw in forum Symbian
    Replies: 0
    Last Post: 2006-09-29, 10:44
  3. Replies: 9
    Last Post: 2004-09-12, 10:08
  4. Replies: 0
    Last Post: 2004-03-17, 08:13
  5. WTK 2.0 won't create jad&manifest files, moreover deletes existing ones..
    By urbandebugger in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2004-03-01, 17:51

Posting Permissions

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