In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

How to draw a rectangle?

I could draw a Circle, by calling graphics.drawCircle
but how can I draw a Rectangle??
graphics.drawCircleを使って円を描くことはできたけど
どうやったら四角形を描けるの??
Get Adobe Flash player
by mash 30 Mar 2009
  • Related works: 1
  • Talk

    irevol at 23 Jul 2009 15:20
    replace line 14 with - graphics.drawRectangle(10,10,100,100); dont forget to to add endFill() after drawing. e.g. graphics.beginFill(0xFF0000); // start drawing in red color, graphics.drawRectangle(10,10,100,100); graphics.endFill(); // end of drawing.

    Tags

    Embed
// I could draw a Circle, by calling graphics.drawCircle
// but how can I draw a Rectangle??
//
// graphics.drawCircleを使って円を描くことはできたけど
// どうやったら四角形を描けるの??
//
package {
    import flash.display.*;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            graphics.beginFill(0xFF0000);
            
            // draw a circle ok
            graphics.drawCircle( 100, 100, 100 );
        }
    }
}

//
// !! don't answer this question, this is just for an example !!
// !! この質問には答えないでください、これは例です。 !!
//