puggsoy
puggsoy

Reputation: 1280

AS3 - Keeping scrollbars on empty ScrollPane

In my app I'm using a ScrollPane. I can load a DisplayObject into it, and it works fine. The thing is that when it's empty, i.e. I haven't loaded anything into it, there aren't any scrollbars on the pane. This makes sense, since there's no scrolling to do, but I'd like there to be "greyed out" scrollbars if possible.

It's not necessary or anything but most programs have it (open an empty .txt file in Notepad and you'll see what I mean), I'd just like to know if my app can do this.

If it helps at all, it's an AIR app made using FlashDevelop with the open-source Flex 4 SDK. I'm getting my components (ScrollPane, etc.) from a SWC.

Upvotes: 0

Views: 884

Answers (1)

shaunhusain
shaunhusain

Reputation: 19748

Set the vertical or horizontal scroll policy according to what you want.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/containers/BaseScrollPane.html#verticalScrollPolicy

scrollPane.verticalScrollPolicy=ScrollPolicy.ON;
scrollPane.horizontalScrollPolicy=ScrollPolicy.ON;

Upvotes: 1

Related Questions