Flash actionscript 3.0: How to Create a Rectangle and Circle dynamically using Action Script 3.0

How to Create a Rectangle and Circle dynamically using Action Script 3.0

Posted by Sankar.G | Posted in | Posted on 11:42 PM

we can create a rectangle or cirlcle using Action Script 3.0

AS3.0
Code

var rect:Shape=new Shape();
rect.graphics.beginFill(0x00FFFF);
rect.graphics.drawRect(75,300,175,75);
addChild(rect);
var cir:Shape=new Shape();
cir.graphics.beginFill(0x00FFFF);
cir.graphics.drawCircle(0,0,40);
cir.x=40;
cir.y=40;
addChild(cir);
var tx:TextField=new TextField();
tx.type=TextFieldType.INPUT;
tx.text="sankar";
addChild(tx);


Syntax
drawRect(x,y,width,height);
drawCircle(x,y,radius);

Comments (0)