draw circle with gradient style using action script

Posted by druva | Flash, as3, utils | Tuesday 1 December 2009 10:12 am

var circle:Shape = new Shape();
addChild(circle);
circle.x = circle.y = 150;
circle.graphics.lineStyle(40);

var gradientColors:Array =
	[
		 0xFF0000,
		 0xFFFF00,
		 0xFF00FF,
		 0xFF6600,
		 0x00FFFF,
		 0x2E0854,
		 0x8F5E00,
		 0x8F5E99,
		 0xFFFF00,
		 0xFF00FF,
		 0xFF6600
	];
var gradientAlphas:Array = [1,1,1,1,1,1,1,1,1,1,1];
var gradientRatios:Array = [0,25,50,75,100,125,150,175,200,225,250];

circle.graphics.lineGradientStyle(GradientType.LINEAR, gradientColors, gradientAlphas, gradientRatios);

circle.graphics.drawCircle(-10, -10, 100);         

This movie requires Flash Player 9

 

Create Rounded Corners Rectangle with Actionscript 3.0 – AS3

Posted by druva | Flash, Flex, as3, utils | Saturday 7 November 2009 8:14 am

Rounded Corner Rectangle

import flash.display.*;

function round_rectangle(){

var shape:Shape = new Shape();
addChild(shape);

shape.graphics.beginFill(0xFF0000FF, 1.0);

shape.graphics.drawRoundRect(50, 10, 200, 100, 30, 30);

shape.graphics.endFill();
}

round_rectangle();

(more…)

 

draw Ellipse with flash action script

Posted by Vineela | Flash, Flex, as3, utils | Saturday 20 June 2009 7:26 am
package druva {

 import flash.display.*;

 public class drawEllipse extends Sprite {

 public function drawEllipse() {
 var canvas:Shape = new Shape(  );
 canvas.graphics.lineStyle(3, 0xFF0000);
 canvas.graphics.drawEllipse(0,0,100,50);
 addChild(canvas);

 }
 }
}

(more…)

 

How to Draw a Square with Flash Actionscript 3.0 – AS3

Posted by druva | Flash, as3, utils | Monday 5 January 2009 1:03 pm

simple Example to draw square using flash actionscript

this example show how to use lineStyle, drawRect, Shape

package druva {

import flash.display.*;

public class drawSquare extends Sprite {

public function drawSquare() {
var canvas:Shape = new Shape( );
canvas.graphics.lineStyle(3, 0xFF0000);
canvas.graphics.drawRect(10,10,100,100);
addChild(canvas);

}
}
}

 

How to Draw a Circle with Flash Actionscript 3.0 – AS3

Posted by Vineela | Flash, Flex, as3, utils | Sunday 4 January 2009 1:14 pm
package druva {

 import flash.display.*;

 public class drawCircle extends Sprite {

 public function drawCircle() {
 var canvas:Shape = new Shape(  );
 canvas.graphics.lineStyle(3, 0xFF0000);
 canvas.graphics.drawCircle(100,100,50);
 addChild(canvas);

 }
 }
}