Recently I stumbled upon a curious issue. Can’t tell whether it is a bug or a feature. For sure it is something unexpected to me. I stripped it down to a minimal example.
Create an empty Adobe Air application and link a css stylesheet.
1 2 3 4 5 6 7 | <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" > <mx:Style source="style.css"/> </mx:WindowedApplication> |
The CSS only sets the background color like this:
1 2 3 | WindowedApplication { backgroundColor: #000000; } |
In the application descriptor set the chrome to none like this:
1 | <systemChrome>none</systemChrome> |
If you run the application you’ll get the following result.

So far everything is behaving like expected. We have a window, with a black background, no system chrome and the flex chrome is visible.
Let’s try to modify the mxml and set the showFlexChrome to false like the following:
1 2 3 4 5 6 7 8 | <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" showFlexChrome="false" > <mx:Style source="style.css"/> </mx:WindowedApplication> |
You would expect to see a black rectangle, with no flex chrome, but instead there is a rectangle with
the default flex color. Why?

If you want to play with the example here is the source code.

When “showFlexChrome” is set to false, the backgroundAlpha style is set to 0. So a work around is on the WindowedApplication’s creationComplete event set the backgroundAlpha back to 1.
So the easier way of doing this is to set the SWF’s background property. You can find the information in a cookbook entry.
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=12868
Also I have posted about this here:
http://renaun.com/blog/2009/02/05/268/
@Renaun thanks for your post! In any case I think we can classify this as an Adobe’s oversight :)
Leave a Reply