1
votes

I am creating a dummy mobile application in Flash Builder 4.5. In application code I am using a VGroup and I am adding and removing elements on rum time. Now I want to set VGroup background color to black.

How can I do this?

1

1 Answers

6
votes

You can't: VGroup is a layout container. It contains no graphic elements.
Read this answer about layout containers for a little more information: Add layout to Flex UIComponent

The easiest solution to your problem, if you don't want to touch the VGroup, would be something like this:

<s:Group>
    <s:Rect left="0" right="0" top="0" bottom="0">
        <s:fill>
            <s:SolidColor color="0x000000" />
        </s:fill>
    </s:Rect>

    <s:VGroup left="0" right="0" top="0" bottom="0">
        <!--content goes here-->
    </s:VGroup>
</s:Group>

But you could also use BorderContainer instead:

<s:BorderContainer backgroundColor="black">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>

    <!--content goes here-->
</s:BorderContainer>