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

  1. class application.screens.HomeScreen extends application.screens.AbstractScreen implements application.models.IScreen
  2. {
  3.    var controller;
  4.    var dataObj;
  5.    var systemObj;
  6.    var configObj;
  7.    var banner0;
  8.    var banner1;
  9.    function HomeScreen()
  10.    {
  11.       super();
  12.    }
  13.    function build()
  14.    {
  15.       var _loc5_ = 0;
  16.       while(_loc5_ < 4)
  17.       {
  18.          var _loc2_ = this["menu" + _loc5_];
  19.          _loc2_.background.controller = this;
  20.          _loc2_.background.useHandCursor = false;
  21.          _loc2_.background.mainId = _loc5_;
  22.          _loc2_.background.subId = 0;
  23.          _loc2_.background.onRelease = function()
  24.          {
  25.             this.controller.onButtonRelease(this);
  26.          };
  27.          _loc2_.headline.text = this.dataObj.content[_loc5_].headline;
  28.          Object.registerClass("dummy",application.ui.PicLoader);
  29.          var _loc7_ = application.ui.PicLoader(_loc2_.attachMovie("dummy","pic" + _loc5_,100));
  30.          _loc7_._x = 3;
  31.          _loc7_._y = 2;
  32.          _loc7_.loadPic(this.dataObj.content[_loc5_].picture,170,110,"left");
  33.          this.buildButton(_loc2_.btn);
  34.          _loc2_.btn.mainId = _loc5_;
  35.          _loc2_.btn.subId = 0;
  36.          this.createFocusRec(_loc2_.btn,_loc2_.btn._width,_loc2_.btn._height,0,0);
  37.          application.core.FocusManager.getInstance().registerButton(_loc2_.btn,10 * (_loc5_ + 1));
  38.          var _loc4_ = 0;
  39.          while(_loc4_ < this.dataObj.content[_loc5_].contentList.length - 1)
  40.          {
  41.             var _loc6_ = this.dataObj.content[_loc5_].contentList[_loc4_ + 1];
  42.             this.buildButton(_loc2_["btn" + _loc4_]);
  43.             _loc2_["btn" + _loc4_].mainId = _loc5_;
  44.             _loc2_["btn" + _loc4_].subId = _loc4_ + 1;
  45.             this.setLabel(_loc2_["btn" + _loc4_],_loc6_.label,true);
  46.             var _loc3_ = _loc2_["btn" + _loc4_].btnbackground;
  47.             this.reszizeButtonBackground(_loc3_,_loc2_["btn" + _loc4_].label._width + 6,_loc3_._height);
  48.             this.createFocusRec(_loc2_["btn" + _loc4_],_loc3_._width + 2,_loc3_._height,-1,_loc3_._y - 1);
  49.             application.core.FocusManager.getInstance().registerButton(_loc2_["btn" + _loc4_],10 * (_loc5_ + 1) + (_loc4_ + 1));
  50.             _loc4_ = _loc4_ + 1;
  51.          }
  52.          if(this.dataObj.content[_loc5_].contentList.length - 1 < 5)
  53.          {
  54.             _loc4_ = 4;
  55.             while(_loc4_ >= this.dataObj.content[_loc5_].contentList.length - 1)
  56.             {
  57.                _loc2_["btn" + _loc4_].gotoAndStop(1);
  58.                _loc2_["btn" + _loc4_]._visible = false;
  59.                _loc4_ = _loc4_ - 1;
  60.             }
  61.          }
  62.          _loc5_ = _loc5_ + 1;
  63.       }
  64.       if(this.systemObj.isWinXP)
  65.       {
  66.          _loc5_ = 0;
  67.          while(_loc5_ < 2)
  68.          {
  69.             _loc3_ = this["banner" + _loc5_];
  70.             this.buildButton(_loc3_.background);
  71.             _loc3_.background.useHandCursor = false;
  72.             _loc3_.background.mainId = 4 + _loc5_;
  73.             _loc3_.background.subId = 0;
  74.             _loc3_.gotoAndStop(1);
  75.             this.buildButton(_loc3_.btn);
  76.             _loc3_.btn.mainId = 4 + _loc5_;
  77.             _loc3_.btn.subId = 0;
  78.             this.setLabel(_loc3_,this.configObj.textList["banner" + _loc5_],false);
  79.             this.createFocusRec(_loc3_.btn,34,34,1,1);
  80.             application.core.FocusManager.getInstance().registerButton(_loc3_.btn,50 + _loc5_);
  81.             _loc5_ = _loc5_ + 1;
  82.          }
  83.       }
  84.       else
  85.       {
  86.          this.buildButton(this.banner0.background);
  87.          this.banner0.background.useHandCursor = false;
  88.          this.banner0.background.mainId = 4;
  89.          this.banner0.background.subId = 0;
  90.          this.banner0.gotoAndStop(2);
  91.          this.buildButton(this.banner0.btn);
  92.          this.banner0.btn.mainId = 4;
  93.          this.banner0.btn.subId = 0;
  94.          this.setLabel(this.banner0,this.configObj.textList.bannerNoneXP,false);
  95.          this.createFocusRec(this.banner0.btn,34,34,1,1);
  96.          application.core.FocusManager.getInstance().registerButton(this.banner0.btn,50);
  97.          this.banner1.gotoAndStop(1);
  98.          this.banner1._visible = false;
  99.       }
  100.    }
  101.    function onButtonRollOver(mc)
  102.    {
  103.       mc.label.textColor = 14418032;
  104.    }
  105.    function onButtonRollOut(mc)
  106.    {
  107.       mc.label.textColor = 0;
  108.    }
  109.    function onButtonPress(mc)
  110.    {
  111.    }
  112.    function onButtonRelease(mc)
  113.    {
  114.       if(mc != this.banner0.btn && mc != this.banner0.background && mc != this.banner1.background && mc != this.banner1.btn)
  115.       {
  116.          application.core.ContentManager.getInstance().showContent(2,mc.mainId,mc.subId);
  117.       }
  118.       else
  119.       {
  120.          application.core.ContentManager.getInstance().showContent(3,mc.mainId,mc.subId);
  121.       }
  122.    }
  123.    function onButtonDisable(mc)
  124.    {
  125.    }
  126.    function onButtonEnable(mc)
  127.    {
  128.    }
  129.    function onButtonReleaseOutside(mc)
  130.    {
  131.       mc.label.textColor = 0;
  132.    }
  133. }
  134.