Drawing A Rectangle

  • Uploaded by: SRINIVASA RAO GANTA
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Drawing A Rectangle as PDF for free.

More details

  • Words: 105
  • Pages: 2
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);

Related Documents

Drawing A Rectangle
May 2020 5
Rectangle
November 2019 12
Rectangle
November 2019 15
Rectangle Patran
November 2019 13
The Rectangle
November 2019 15
Rectangle Mandouli
November 2019 14

More Documents from ""