Search code examples
flashapache-flexflex4flex-spark

Why is my rect fills a different color when opening in a popup?


I'm adding a Group that contains a Rect fill inside a panel. The panel contains two states normal and normalWithControlBar. The group is in the normalWithControlBar. In an isolated test it works correctly. When it is displayed in my application the Rect background fill does not appear with the correct color.

I think that there may be blendMode being set somewhere but I'm not sure if that's it or where and why it is being applied.

I also have Rotate3D effect that may be the cause of it. Since it is a large application I'm working my way through what it could be but until then has anyone heard of this or what could be causing it? Thanks

Example code:

In Panel:

<MyPanel>
    <s:controlBarContent>
        <local:MyGroup width="500" height="230"/><!--appears tinted-->
    </s:controlBarContent>

    <local:MyGroup width="500" height="230"/><!--appears normal-->
</MyPanel>

In MyGroup:

<s:Rect width="100%" height="80"
        top="100"
            >
    <s:fill>
        <s:SolidColor color="#dddddd"/>
    </s:fill>
</s:Rect>

Solution

  • Found it. The reason it is happening is because the Group was not added to the list of exclusions in the Panel's skin class and a chromeColor was specified in the Application CSS.

    In MyPanelSkin:

    Before:

    /* Define the skin elements that should not be colorized. */
    static private const exclusions:Array = ["background", "titleDisplay", "contentGroup", "controlBarGroup", "border"];
    

    After:

    /* Define the skin elements that should not be colorized. */
    static private const exclusions:Array = ["myGroup", "background", "titleDisplay", "contentGroup", "controlBarGroup", "border"];
    

    Once I added my skin part to the list of exclusions the fill color displayed correctly.