home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / mallcrawl.swf / scripts / __Packages / mx / skins / halo / RectBorder.as < prev   
Encoding:
Text File  |  2007-09-28  |  6.7 KB  |  183 lines

  1. class mx.skins.halo.RectBorder extends mx.skins.RectBorder
  2. {
  3.    var offset;
  4.    var __borderMetrics;
  5.    var _color;
  6.    var drawRoundRect;
  7.    static var symbolName = "RectBorder";
  8.    static var symbolOwner = mx.skins.halo.RectBorder;
  9.    static var version = "2.0.2.126";
  10.    var borderCapColorName = "borderCapColor";
  11.    var shadowCapColorName = "shadowCapColor";
  12.    var colorList = {highlightColor:0,borderColor:0,buttonColor:0,shadowColor:0,borderCapColor:0,shadowCapColor:0};
  13.    var borderWidths = {none:0,solid:1,inset:2,outset:2,alert:3,dropDown:2,menuBorder:2,comboNonEdit:2};
  14.    static var classConstructed = mx.skins.halo.RectBorder.classConstruct();
  15.    static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
  16.    function RectBorder()
  17.    {
  18.       super();
  19.    }
  20.    function init(Void)
  21.    {
  22.       this.borderWidths["default"] = 3;
  23.       super.init();
  24.    }
  25.    function getBorderMetrics(Void)
  26.    {
  27.       if(this.offset == undefined)
  28.       {
  29.          var _loc3_ = this.getStyle(this.borderStyleName);
  30.          this.offset = this.borderWidths[_loc3_];
  31.       }
  32.       if(this.getStyle(this.borderStyleName) == "default" || this.getStyle(this.borderStyleName) == "alert")
  33.       {
  34.          this.__borderMetrics = {left:3,top:1,right:3,bottom:3};
  35.          return this.__borderMetrics;
  36.       }
  37.       return super.getBorderMetrics();
  38.    }
  39.    function drawBorder(Void)
  40.    {
  41.       var _loc6_ = _global.styles[this.className];
  42.       if(_loc6_ == undefined)
  43.       {
  44.          _loc6_ = _global.styles.RectBorder;
  45.       }
  46.       var _loc5_ = this.getStyle(this.borderStyleName);
  47.       var _loc7_ = this.getStyle(this.borderColorName);
  48.       if(_loc7_ == undefined)
  49.       {
  50.          _loc7_ = _loc6_[this.borderColorName];
  51.       }
  52.       var _loc8_ = this.getStyle(this.backgroundColorName);
  53.       if(_loc8_ == undefined)
  54.       {
  55.          _loc8_ = _loc6_[this.backgroundColorName];
  56.       }
  57.       var _loc16_ = this.getStyle("backgroundImage");
  58.       if(_loc5_ != "none")
  59.       {
  60.          var _loc14_ = this.getStyle(this.shadowColorName);
  61.          if(_loc14_ == undefined)
  62.          {
  63.             _loc14_ = _loc6_[this.shadowColorName];
  64.          }
  65.          var _loc13_ = this.getStyle(this.highlightColorName);
  66.          if(_loc13_ == undefined)
  67.          {
  68.             _loc13_ = _loc6_[this.highlightColorName];
  69.          }
  70.          var _loc12_ = this.getStyle(this.buttonColorName);
  71.          if(_loc12_ == undefined)
  72.          {
  73.             _loc12_ = _loc6_[this.buttonColorName];
  74.          }
  75.          var _loc11_ = this.getStyle(this.borderCapColorName);
  76.          if(_loc11_ == undefined)
  77.          {
  78.             _loc11_ = _loc6_[this.borderCapColorName];
  79.          }
  80.          var _loc10_ = this.getStyle(this.shadowCapColorName);
  81.          if(_loc10_ == undefined)
  82.          {
  83.             _loc10_ = _loc6_[this.shadowCapColorName];
  84.          }
  85.       }
  86.       this.offset = this.borderWidths[_loc5_];
  87.       var _loc9_ = this.offset;
  88.       var _loc3_ = this.width;
  89.       var _loc4_ = this.height;
  90.       this.clear();
  91.       this._color = undefined;
  92.       if(_loc5_ != "none")
  93.       {
  94.          if(_loc5_ == "inset")
  95.          {
  96.             this._color = this.colorList;
  97.             this.draw3dBorder(_loc11_,_loc12_,_loc7_,_loc13_,_loc14_,_loc10_);
  98.          }
  99.          else if(_loc5_ == "outset")
  100.          {
  101.             this._color = this.colorList;
  102.             this.draw3dBorder(_loc11_,_loc7_,_loc12_,_loc14_,_loc13_,_loc10_);
  103.          }
  104.          else if(_loc5_ == "alert")
  105.          {
  106.             var _loc15_ = this.getStyle("themeColor");
  107.             this.drawRoundRect(0,5,_loc3_,_loc4_ - 5,5,6184542,10);
  108.             this.drawRoundRect(1,4,_loc3_ - 2,_loc4_ - 5,4,[6184542,6184542],10,0,"radial");
  109.             this.drawRoundRect(2,0,_loc3_ - 4,_loc4_ - 2,3,[0,14342874],100,0,"radial");
  110.             this.drawRoundRect(2,0,_loc3_ - 4,_loc4_ - 2,3,_loc15_,50);
  111.             this.drawRoundRect(3,1,_loc3_ - 6,_loc4_ - 4,2,16777215,100);
  112.          }
  113.          else if(_loc5_ == "default")
  114.          {
  115.             this.drawRoundRect(0,5,_loc3_,_loc4_ - 5,{tl:5,tr:5,br:0,bl:0},6184542,10);
  116.             this.drawRoundRect(1,4,_loc3_ - 2,_loc4_ - 5,{tl:4,tr:4,br:0,bl:0},[6184542,6184542],10,0,"radial");
  117.             this.drawRoundRect(2,0,_loc3_ - 4,_loc4_ - 2,{tl:3,tr:3,br:0,bl:0},[12897484,11844796],100,0,"radial");
  118.             this.drawRoundRect(3,1,_loc3_ - 6,_loc4_ - 4,{tl:2,tr:2,br:0,bl:0},16777215,100);
  119.          }
  120.          else if(_loc5_ == "dropDown")
  121.          {
  122.             this.drawRoundRect(0,0,_loc3_ + 1,_loc4_,{tl:4,tr:0,br:0,bl:4},[13290186,7895160],100,-10,"linear");
  123.             this.drawRoundRect(1,1,_loc3_ - 1,_loc4_ - 2,{tl:3,tr:0,br:0,bl:3},16777215,100);
  124.          }
  125.          else if(_loc5_ == "menuBorder")
  126.          {
  127.             _loc15_ = this.getStyle("themeColor");
  128.             this.drawRoundRect(4,4,_loc3_ - 2,_loc4_ - 3,0,[6184542,6184542],10,0,"radial");
  129.             this.drawRoundRect(4,4,_loc3_ - 1,_loc4_ - 2,0,6184542,10);
  130.             this.drawRoundRect(0,0,_loc3_ + 1,_loc4_,0,[0,14342874],100,250,"linear");
  131.             this.drawRoundRect(0,0,_loc3_ + 1,_loc4_,0,_loc15_,50);
  132.             this.drawRoundRect(2,2,_loc3_ - 3,_loc4_ - 4,0,16777215,100);
  133.          }
  134.          else if(_loc5_ != "comboNonEdit")
  135.          {
  136.             this.beginFill(_loc7_);
  137.             this.drawRect(0,0,_loc3_,_loc4_);
  138.             this.drawRect(1,1,_loc3_ - 1,_loc4_ - 1);
  139.             this.endFill();
  140.             this._color = this.borderColorName;
  141.          }
  142.       }
  143.       if(_loc8_ != undefined)
  144.       {
  145.          this.beginFill(_loc8_);
  146.          this.drawRect(_loc9_,_loc9_,this.width - _loc9_,this.height - _loc9_);
  147.          this.endFill();
  148.       }
  149.    }
  150.    function draw3dBorder(c1, c2, c3, c4, c5, c6)
  151.    {
  152.       var _loc3_ = this.width;
  153.       var _loc2_ = this.height;
  154.       this.beginFill(c1);
  155.       this.drawRect(0,0,_loc3_,_loc2_);
  156.       this.drawRect(1,0,_loc3_ - 1,_loc2_);
  157.       this.endFill();
  158.       this.beginFill(c2);
  159.       this.drawRect(1,0,_loc3_ - 1,1);
  160.       this.endFill();
  161.       this.beginFill(c3);
  162.       this.drawRect(1,_loc2_ - 1,_loc3_ - 1,_loc2_);
  163.       this.endFill();
  164.       this.beginFill(c4);
  165.       this.drawRect(1,1,_loc3_ - 1,2);
  166.       this.endFill();
  167.       this.beginFill(c5);
  168.       this.drawRect(1,_loc2_ - 2,_loc3_ - 1,_loc2_ - 1);
  169.       this.endFill();
  170.       this.beginFill(c6);
  171.       this.drawRect(1,2,_loc3_ - 1,_loc2_ - 2);
  172.       this.drawRect(2,2,_loc3_ - 2,_loc2_ - 2);
  173.       this.endFill();
  174.    }
  175.    static function classConstruct()
  176.    {
  177.       mx.core.ext.UIObjectExtensions.Extensions();
  178.       _global.styles.rectBorderClass = mx.skins.halo.RectBorder;
  179.       _global.skinRegistry.RectBorder = true;
  180.       return true;
  181.    }
  182. }
  183.