sivaramaiah  
 
  Record12 03/29/2024 7:21am (UTC)
   
 
Record 12: Drawing a Rectangle
(a)       Rectangle.as               file
class Rectangle
{
private var width:Number;
private var height:Number;
private var mc:MovieClip;
public function Rectangle(w:Number,h:Number,x:Number,y:Number,target:MovieClip,depth:Number)
{
mc=target.createEmptyMovieClip("boxcontainer"+depth,depth);
setWidth(w);
setHeight(h);
setX(x);
setY(y);
}
public function getWidth():Number
{
return width;
}
public function setWidth(w:Number):Void
{
width=w;
draw();
}
public function getHeight():Number
{
return height;
}
public function setHeight(h:Number):Void
{
height=h;
draw();
}
public function getX():Number
{
return mc._x;
}
public function setX(x:Number):Void
{
mc._x=x;
}
public function getY():Number
{
return mc._y;
}
public function setY(y:Number):Void
{
mc._y=y;
}
public function draw():Void
{
mc.clear();
mc.lineStyle(1,0x000000);
mc.moveTo(0,0);
mc.beginFill(0xffffff,100);
mc.lineTo(width,0);
mc.lineTo(width,height);
mc.lineTo(0,height);
mc.lineTo(0,0);
mc.endFill();
}
}
------------------------------------------------------------------------------------
(b)   Rectangle.fla           file
-----------------------------------------------------------------------------------
var b:Rectangle=new Rectangle(250,260,100,110,this,1);

 
  Menu Items
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

  add
HOT TOPICS
MCA PROJECT DETAILS ------------------------------------- Jntu all Lab manuals ------------------------------------- Jntu Syllabus Books ------------------------------------- Paper presentations ------------------------------------- Seminars ------------------------------------- Campus Papers ------------------------------------- Competetive Exams GATE ------------------------------------- GRE ------------------------------------- TOEFL ------------------------------------- IELTS ------------------------------------- CAT ------------------------------------- GMAT ------------------------------------- Templates ------------------------------------- Students Resume Preparation tips ------------------------------------- Job zone(Interview questions) ------------------------------------- Google Adsence html code ------------------------------------- Web sites --------x--------------x-----------
  Advertisement

 


-----------------------------
  Offline Messages
  Adds
  Visitors Information
Today, there have been 118788 visitors (279558 hits) on this page!
-------------------------------------------------- This website was created for free with Own-Free-Website.com. Would you also like to have your own website?
Sign up for free