home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 May / ME_2011_05.iso / Galileo-Video-Tutorial / system / player.swf / scripts / com / je / draw / Rect.as < prev   
Encoding:
Text File  |  2010-11-30  |  2.0 KB  |  69 lines

  1. package com.je.draw
  2. {
  3.    import flash.display.Sprite;
  4.    
  5.    public class Rect extends Sprite
  6.    {
  7.       private var _width:Number;
  8.       
  9.       private var _height:Number;
  10.       
  11.       private var _cornerRadius:Number;
  12.       
  13.       private var _color:uint;
  14.       
  15.       private var _border:Boolean;
  16.       
  17.       private var _alpha:Number;
  18.       
  19.       public function Rect(param1:Number, param2:Number, param3:uint = 0, param4:Number = 0, param5:Boolean = false, param6:Number = 1)
  20.       {
  21.          super();
  22.          this._width = param1;
  23.          this._height = param2;
  24.          this._color = param3;
  25.          this._alpha = param6;
  26.          this._border = param5;
  27.          this._cornerRadius = param4;
  28.          this.draw(this._width,this._height);
  29.       }
  30.       
  31.       public function draw(param1:Number, param2:Number) : void
  32.       {
  33.          graphics.clear();
  34.          if(this._border)
  35.          {
  36.             graphics.lineStyle(1,16777215,1,true);
  37.          }
  38.          graphics.beginFill(this._color,this._alpha);
  39.          graphics.drawRoundRectComplex(0,0,param1,param2,this._cornerRadius,this._cornerRadius,this._cornerRadius,this._cornerRadius);
  40.          graphics.endFill();
  41.       }
  42.       
  43.       public function drawComplex(param1:Number, param2:Number, param3:Array) : void
  44.       {
  45.          graphics.clear();
  46.          if(this._border)
  47.          {
  48.             graphics.lineStyle(1,16777215);
  49.          }
  50.          graphics.beginFill(this._color,this._alpha);
  51.          graphics.drawRoundRectComplex(0,0,param1,param2,param3[0],param3[1],param3[2],param3[3]);
  52.          graphics.endFill();
  53.       }
  54.       
  55.       public function colorize(param1:uint, param2:Number) : void
  56.       {
  57.          graphics.clear();
  58.          if(this._border)
  59.          {
  60.             graphics.lineStyle(1,16777215);
  61.          }
  62.          graphics.beginFill(param1,param2);
  63.          graphics.drawRoundRectComplex(0,0,width,height,this._cornerRadius,this._cornerRadius,this._cornerRadius,this._cornerRadius);
  64.          graphics.endFill();
  65.       }
  66.    }
  67. }
  68.  
  69.