Return to Snippet

Revision: 26494
at April 29, 2010 04:40 by dai


Initial Code
var mat:Matrix = new Matrix();
var bg:Sprite = new Sprite();
mat.createGradientBox( stage.stageWidth, stage.stageHeight, Math.PI * .5 );
bg.graphics.beginGradientFill( GradientType.RADIAL, [ 0xFFFFFF, 0xFF0000 ], [ 1, 1 ], [ 0, 255 ], mat );
bg.graphics.drawRect( 0, 0, stage.stageWidth, stage.stageHeight );
bg.graphics.endFill();
addChild( bg );

Initial URL


Initial Description
If you’ve ever wanted to create a block of filled colour with a gradient for a background, similar to the standard Flex background

Initial Title
Create Gradient

Initial Tags


Initial Language
ActionScript 3