Skip to main content
Participant
June 20, 2011
Question

Flex 4.5.1 SDK & default-background-color Compiler Argument

  • June 20, 2011
  • 1 reply
  • 1936 views

Hey guys,

I was scanning the available compiler arguments list (http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a92.html) for Flex 4.5 SDK and noticed that the -default-background-color argument is gone (I realize it's been gone since 4 just haven't used the SDK much lately).  My background shows up as black when I run my app (it's an AS3 app with the new Away3D 4.0 Broomstick library) and there is no Flex code in my app so I was depending on this compiler argument to set my background color to white.

How can I achieve this now that the argument is no longer available?  I just simply want to have a white background without physically having to create a white sprite in the back of my scene.  Is this possible anymore?

Matt

This topic has been closed for replies.

1 reply

Inspiring
June 20, 2011

Hey There,

If you are using just and ActionScript Sprite you can use metadata to set the background color.

package {
    [SWF(backgroundColor="#FFFFFF")]
    public class Main extends Sprite {

    }
}

Participant
June 20, 2011

Simeon,

Thanks for that, I had a brainfart and forgot you can have the properties defined in that manner.  I changed it but it still wasn't working which made me realize I had to change the backgroundColor property on the view in Away3D.  I realized this after trying the params for the class and then not adding the view (which had a white bg) and then i looked at the docs and bam, there it was.  Thanks!

Matt

Participant
August 16, 2011

good to hear! I'm using flex SDK v 4.5.1 too and the compiler arguments (more specifically -default-background-color) work great for me,

but it's wield that the metadata method doesn't work for me, I wonder if it's because I'm using flashdevelop instead of flash IDE or flex.

Jack