Flex: Using custom scrollbar skins? You’ll run into this problem!

Posted on November 30, 2006 | Filed Under Adobe Flex 

I’m working on a custom look for an Adobe Flex app and ran into a hard-coded annoyance. The mx:Container class has a hard-coded “whiteBox” shape that is used to (wait for it!) display a white box in the bottom-right corner of the container’s content area if both horizontal and vertical scroll bars are being displayed, as seen below. Keep reading if you want to know how to fix this…

The hard-coded white box

Despite there being numerous “…Skin” properties throughout the Flex components to allow you to customize the look of your app, the magical white box somehow managed to be hard-coded as a private variable and instantiated in a private function. Here’s the code snippets of interest from mx/core/Container.as:

Fortunately, it has to be added to the display list to show up on the screen and they assigned a name to it. This makes it easy enough to get rid of. You’ll need to create an ActionScript class that extends a Container-derived class (such as mx:Panel, mx:TitleWindow, etc.) and override a couple of functions, like so:

This'll fix their wagon!

And voilĂ ! The white box is gone.

No more white box!

One final note: In my testing, their comments regarding the container’s children being visible in the area covered by the white box isn’t valid. Apparently, they fixed that issue but forgot to remove the box.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Comments

2 Responses to “Flex: Using custom scrollbar skins? You’ll run into this problem!”

  1. Revisiting the Flex whiteBox issue : TommyB.com on April 29th, 2007 10:28 am

    […] Flex: Using custom scrollbar skins? You’ll run into this problem! […]

  2. Spacedust » Skinning components in flex: tips on January 16th, 2008 5:14 pm

    […] custom scrollbars you can run into this problem: Do you see the white box between the scrollbars? This article describes how to fix […]

Leave a Reply