All pastes #256262 Raw Edit

Miscellany

public text v1 · immutable
#256262 ·published 2006-11-23 22:54 UTC
rendered paste body
class Main {

   public static function main () : Void {
      this.createEmptyMovieClip("rectangle_mc", 10);
      rectangle_mc._x = 100;
      rectangle_mc._y = 100;
      drawRectangle(rectangle_mc, 240, 180, 0x99FF00, 100);
   }

   public static function drawRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, fillColor:Number, fillAlpha:Number):Void {
      with (target_mc) {
        beginFill(fillColor, fillAlpha);
        moveTo(0, 0);
        lineTo(boxWidth, 0);
        lineTo(boxWidth, boxHeight);
        lineTo(0, boxHeight);
        lineTo(0, 0);
        endFill();
      }
   }
}