Transparent Background Color for Flex 2 Panels

| No Comments | No TrackBacks

I've seen this question a few times: How do I make an mx:Panel with a transparent background color? The white just isn't doing it for me...

By default, the mx:Panel has a white background:

panel-white.jpg

In order to remove the white background, the secret is the backgroundAlpha attribute of the mx:Panel tag. By setting the backgroundAlpha to ".4", the default white background will not be displayed and will look transparent instead:

panel.jpg

The following MXML demonstrates setting the backgroundAlpha:

<mx:Panel width="200" height="200" title="Example" backgroundAlpha=".4" />

Remember that the alpha properties you may be used to using ranged from 0-100 and were interpreted as the straight % (where 100 = 100%). In Flex 2, the alpha values range from 0-1 (where 1 is 100%). Therefore, setting the alpha to a value of .4 actually means 40% alpha.

No TrackBacks

TrackBack URL: http://www.darronschall.com/mt/mt-tb.cgi/91

Leave a comment

Flex.org - The Directory for Flex

Archives