I ran into the scrollbar "white box" problem also and this posting
helped, but there is a problem with the workaround. While it will work
if the scrollbars are static, if they are dynamically added and removed
then an error will occur when the scrollbars are removed because they
will attempt to remove the child "whiteBox" which is no longer on the
display list.

Here's the technique that I came up with that is even easier. In your
container add the following event listener to the initialization code:

addEventListener(Event.ADDED, whiteBoxCheck);

And then add the following listener function:

private function whiteBoxCheck(event:Event):void {
     if (event.target.name == "whiteBox") {
         FlexShape(event.target).alpha = 0;
     }
}

If you'd rather create a solid color "white box", use this:

private function whiteBoxCheck(event:Event):void {
     if (event.target.name == "whiteBox") {
         var whiteBox:FlexShape = FlexShape(event.target);
         var g:Graphics = whiteBox.graphics;
         g.beginFill(0xFF0000);
         g.drawRect(0, 0, whiteBox.width, whiteBox.height);
         g.endFill();
     }
}

Hope this is useful to someone!

Paul


--- In flexcoders@yahoogroups.com, "tombaggett" <[EMAIL PROTECTED]> wrote:
>
> I'm in the process of creating a custom look for a Flex app and ran
into
> a problem while creating custom skins for scrollbars.  There is a
> hard-coded shape object in the mx:Container class that creates a white
> box in the bottom-right corner, between the horizontal and vertical
> scroll bars.
>
> The "whiteBox" object is declared as a private data member and
> instantiated and destroyed in a private function, seemingly putting it
> out of reach of my derived classes.  Fortunately, I found an easy
> workaround that I post about in detail on my blog here:
>
>
http://tommyb.com/2006/11/30/flex-using-custom-scrollbar-skins-youll-run\
\
> -into-this-problem/
>
<http://tommyb.com/2006/11/30/flex-using-custom-scrollbar-skins-youll-ru\
\
> n-into-this-problem/>
>
> The short version of it is this:  Create overridden versions of both
the
> createChildren and validateDisplayList functions, locate the shape by
> name in the display list and delete it.  FYI for anyone else that runs
> into this problem!
>

Reply via email to