/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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;