Thanks… I was hoping to avoid going down that path.

From the absence of alternative response, sounds like that might the only way…

Seems like a useful feature for Flex’s builtin components to support.

 

-Engkee

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL
Sent: Wednesday, July 19, 2006 5:38 PM
To: [email protected]
Subject: Re: [flexcoders] gradient background color on VBox

 

Override updateDisplayList, and draw it.

http://pastebin.de/9345

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:local="*">
<local:VBoxGradientBackground>
<mx:Button label="Sup, Imma Button" />
<mx:Button label="I'm here to showcase vert" />
<mx:Button label="YOu mean like skating?" />
<mx:Button label="Naw man... Flex' VBox" />
</local:VBoxGradientBackground>
</mx:Application>

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">

<mx:Script>
<![CDATA[

import flash.display.Graphics;

override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);

var fillType:String = GradientType.LINEAR;
var colors:Array = [0xFF0000, 0x0000FF];
var alphas:Array = [100, 100];
var ratios:Array = [0, 255];
var matrix:Matrix = new Matrix();
matrix.createGradientBox(unscaledWidth, unscaledHeight, 45);
var spreadMethod:String = SpreadMethod.PAD;

graphics.clear();
graphics.beginGradientFill(fillType, colors, alphas, ratios, matrix,
spreadMethod);
graphics.drawRect(2, 2, unscaledWidth - 2, unscaledHeight - 2);
graphics.endFill();
}

]]>
</mx:Script>

</mx:VBox>

----- Original Message -----
From: "Engkee Kwang" <[EMAIL PROTECTED]com>
To: <[EMAIL PROTECTED]ups.com>
Sent: Wednesday, July 19, 2006 8:02 PM
Subject: [flexcoders] gradient background color on VBox

is there a way to set gradient background color on a VBox.

it does not allow me to specify an array of color on backgroundColor
property.

same question wrt. background alpha.

-Engkee

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to