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



About this Entry

This page contains a single entry by darron published on February 8, 2006 9:39 AM.

Reminder: Central Penn CFUG meeting tonight was the previous entry in this blog.

Using the new * DataType in ActionScript 3 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02