dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Disabling UIScrollBar?

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    6

    Disabling UIScrollBar?

    Not sure if there is an easy way to go about this or not as I have yet to find an answer.

    I have a dynamic text box that loads its text from external .txt files, and depending on which file is loaded, the length of the content in the dynamic text box changes. The text box holds about fifteen lines of text without needing to be scrolled, but the actual text varies from six or so lines to about fifty lines.

    What I'm looking to do is have the scrollbar component not be displayed if the contents of the dynamic text box don't require scrolling. Any suggestions?

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You can do something like that:
    bb.visible = false;
    if(aa.textHeight>aa._height)
    {
    bb.visible = true;
    }

    But you need to use setInterval or so to monitor the textfield size always or add it to a button script.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Junior Member
    Join Date
    Oct 2007
    Posts
    8
    Hi. I understand the concept but am a bit confused how to code it. Could you possibly explain a little more? Many thanks

  4. #4
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    bb is the name of the scrollbar and aa the name of the textfield. Sorry for the naming.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  5. #5
    Junior Member
    Join Date
    Oct 2007
    Posts
    8
    Thanks. I actually got some nifty code from another forum that works well if anyone is interested:


    setInterval(checkScrollBar, 1000);
    function checkScrollBar() {
    trace(scrollbar.downArrow_mc.enabled);
    if (scrollbar.downArrow_mc.enabled == false) {
    scrollbar._alpha = 0;
    } else {
    scrollbar._alpha = 100;
    }
    }

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