I have tried playing around with various combinations of the following MXML component:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="80%" height="100%">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:DropShadowFilter id="mainDSF" color="0x000000" alpha=".7" blurX="20" blurY="20" quality="1" distance="0" />
</fx:Declarations>
<s:Graphic>
<s:Rect width="200" height="200" bottomLeftRadiusX="10" bottomLeftRadiusY="10"
bottomRightRadiusX="10" bottomRightRadiusY="10" filters="{[mainDSF]}"
horizontalCenter="0">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0x57DDF5" ratio=".05" />
<s:GradientEntry color="0x32D2F2" ratio=".25" />
<s:GradientEntry color="0x01B7E6" />
</s:LinearGradient>
</s:fill>
</s:Rect>
</s:Graphic>
</s:Group>
I have been unsuccessful in my attempts to do something that should be very simple. I simply want to draw a gradient filled box with a dropshadow which, when created using the popupManager in my main MXML file, will be 80% of the screen width and 15% of the screen height.
The values currently in my code example above are in pixels but that is not desirable. They are there since FlashBuilder 4.5 makes things disappear from view as soon as I change these to percentages.
I've tried wrapping the Rect with a Graphic tag, tried various combinations of width, percentageWidth, left & right values.. etc etc etc (Note, the left, right, top and bottom properties would also be undesirable as I wish to move this box from just off the top of the screen into the top section of the MXML document)
Any help with this would be most appreciated.