home *** CD-ROM | disk | FTP | other *** search
/ T-Online 6 / T-Online.iso / Animation / content / intro / intro.swf / scripts / __Packages / application / ui / FocusBorder.as < prev    next >
Encoding:
Text File  |  2005-10-20  |  1.6 KB  |  62 lines

  1. class application.ui.FocusBorder extends application.screens.AbstractScreen
  2. {
  3.    var holder;
  4.    var configObj;
  5.    var activeBtn;
  6.    static var instance;
  7.    function FocusBorder()
  8.    {
  9.       super();
  10.    }
  11.    static function getInstance()
  12.    {
  13.       if(application.ui.FocusBorder.instance == null)
  14.       {
  15.          application.ui.FocusBorder.instance = new application.ui.FocusBorder();
  16.       }
  17.       return application.ui.FocusBorder.instance;
  18.    }
  19.    function setHolder(holder)
  20.    {
  21.       this.holder = holder;
  22.    }
  23.    function showBorder(mc)
  24.    {
  25.       var _loc5_ = mc.rect._width - 4;
  26.       var _loc4_ = mc.rect._height - 4;
  27.       var _loc2_ = new Object();
  28.       _loc2_.x = mc.rect._x;
  29.       _loc2_.y = mc.rect._y;
  30.       mc.localToGlobal(_loc2_);
  31.       this.holder._x = _loc2_.x;
  32.       this.holder._y = _loc2_.y;
  33.       this.holder.clear();
  34.       this.holder.lineStyle(2,this.configObj.tabBorderColor,100);
  35.       this.holder.moveTo(0,0);
  36.       this.holder.lineTo(_loc5_,0);
  37.       this.holder.lineTo(_loc5_,_loc4_);
  38.       this.holder.lineTo(0,_loc4_);
  39.       this.holder.lineTo(0,0);
  40.       this.activeBtn = mc;
  41.    }
  42.    function repos()
  43.    {
  44.       var _loc4_ = this.activeBtn.rect._width - 4;
  45.       var _loc3_ = this.activeBtn.rect._height - 4;
  46.       var _loc2_ = new Object();
  47.       _loc2_.x = this.activeBtn.rect._x;
  48.       _loc2_.y = this.activeBtn.rect._y;
  49.       this.activeBtn.localToGlobal(_loc2_);
  50.       this.holder._x = _loc2_.x;
  51.       this.holder._y = _loc2_.y;
  52.    }
  53.    function hide()
  54.    {
  55.       this.holder.clear();
  56.    }
  57.    function onScrollonKeyEvent()
  58.    {
  59.       this.repos();
  60.    }
  61. }
  62.