Well, I just happened to figure out what the problem was. Much to my 
dismay and exuberance.

For those of you interested in this I will give you the quick definition.

This quote: "This value defines the percentage of the width where the 
color is sampled at 100%." I assumed that this meant the width of the 
gradient, when it actually means the width of the gradient box. Gradient 
box isn't a required parameter and I am not sure what the defaults are 
but when you create a gradient box with the width of the gradient the 
ratios work properly as per my example here.

gMat.createGradientBox(127,20,0,0,0);
grad.graphics.beginGradientFill(GradientType.LINEAR,[0xFFFFFF,0xFFFFFF],[0,1],[0,255],gMat);
grad.graphics.drawRect(0,0,127,refButton.height);

-Trey

Trey Long wrote:
> If someone has any experience with drawing gradients with the GRAPHICS 
> object please, your input would be invaluable.
> 
> My issue is with the RATIO attribute of beginGradientFill(). I can't 
> seem to understand exactly what the numbers in that array represent.
> 
> For instance, to get a gradient all the way across a rectangle I would 
> specify, according to the docs, [0,255] or [0x00,0xFF]. That I can 
> understand, but what happens on the screen doesn't appear to be anything 
> like what the docs say.
> 
> If anyone has had any experience, or could figure out the example I have 
> included I would be forever grateful.
> 
> This draws a rectangle in which the white is truncated abruptly instead 
> of fading out to nothing gracefully like I would think.
> 
> var grad:UIComponent = new UIComponent();
> grad.graphics.beginGradientFill(GradientType.LINEAR,[0xFFFFFF,0xFFFFFF],[0,1],[0,255]);
> grad.graphics.drawRect(0,0,200,20);
> grad.graphics.endFill();
> addChild(grad);
> 
> -Trey
> 
> 
> --
> 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 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to