Return to Snippet

Revision: 3142
at June 7, 2007 14:23 by mswallace


Initial Code
var squareDrawing:MovieClip = new MovieClip();
this.addChild(squareDrawing);

squareDrawing.graphics.lineStyle(1, 0x000000, 1);
var fillType:String = GradientType.RADIAL;
var colors:Array = [0xFF0000, 0x0000FF];
var alphas:Array = [100, 100];
var ratios:Array = [0, 255];
var matr:Matrix = new Matrix();
matr.createGradientBox(200, 100, 0, -50, 100);
var spreadMethod:String = SpreadMethod.REFLECT; //REPEATE, PAD, OR REFLECT

squareDrawing.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);


squareDrawing.graphics.drawRect (0, 0, 100, 300);
squareDrawing.graphics.endFill();
squareDrawing.graphics.drawRoundRect(200, 0, 100, 300, 50);

var blur:BlurFilter = new BlurFilter();

blur.blurX = 10;
blur.blurY = 10;
blur.quality = 1;

var filterArray:Array = new Array(blur);
squareDrawing.filters = filterArray;


squareDrawing.x = 500;
squareDrawing.y = 100;

Initial URL

                                

Initial Description

                                

Initial Title
AS3 Draw Square, Blur, and Gradiant Fill

Initial Tags
actionscript, flash, api, 3

Initial Language
ActionScript 3