Set up a matrix which determines the gradient box and pass it to the
beginGradientFill(), e.g:
var m: Matrix = new Matrix();
m.createGradientBox(100, 100);
_grad.graphics.beginGradientFill("linear", [0xff, 0xff, 0xff,
0xff], [1, 1, 1, 1], [0,85,170,255], m);
Attila
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
From:Rob Romanek <[EMAIL PROTECTED]>
To: flashcoders@chattyfig.figleaf.com
Date:Wednesday, July 18, 2007, 7:48:01 PM
Subject: [Flashcoders] AS3 BitmapGradientFill
--===--
I'm sure I'm missing something basic here. In Flash 9 I'm trying to create
a gradient fill that starts at blue, over the first 3rd of the shape it
fades to white, remains solid white over the next 3rd then over the final
3rd it fades from white back to blue. I thought the code below should do
it but I get an image that starts off solid white for about the first 3rd
then fades to blue.
Any suggestions on what I'm doing wrong.
Thanks,
Rob
var _grad:Shape = new Shape();
_grad.graphics.beginGradientFill("linear", [0xff, 0xff, 0xff,
0xff], [1, 1, 1, 1], [0,85,170,255]);
_grad.graphics.drawRect(0,0,100,100);
_grad.graphics.endFill();
addChild(_grad);
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com