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

  1. class application.screens.RateScreen extends application.screens.AbstractScreen implements application.models.IScreen
  2. {
  3.    var activeSub;
  4.    var contentMC;
  5.    var layout;
  6.    var param;
  7.    var dataObj;
  8.    var numberOfRows;
  9.    var gridLayout;
  10.    var gridManager;
  11.    var tf;
  12.    var rootMC;
  13.    function RateScreen()
  14.    {
  15.       super();
  16.    }
  17.    function setActiveSub(activeSub)
  18.    {
  19.       this.activeSub = activeSub;
  20.    }
  21.    function setContentMC(contentMC)
  22.    {
  23.       this.contentMC = contentMC;
  24.    }
  25.    function build()
  26.    {
  27.       this.layout = new components.ui.gridLayout.data.LayoutData();
  28.       this.param = this.dataObj.client.contentList[this.activeSub].param;
  29.       var _loc11_ = this.dataObj.client.contentList[this.activeSub].rateContent;
  30.       this.numberOfRows = _loc11_.contentsList.length;
  31.       var _loc4_ = _loc11_.groups[0].name == null ? 3 : 4;
  32.       this.layout.setGridLayout(this.numberOfRows,_loc4_,false,1,1,1);
  33.       var _loc7_ = [];
  34.       var _loc10_ = [];
  35.       var _loc12_ = new components.ui.gridLayout.config.Config();
  36.       var _loc2_ = 0;
  37.       var _loc3_ = 0;
  38.       while(_loc3_ < _loc4_)
  39.       {
  40.          _loc7_[_loc2_] = 1;
  41.          _loc10_[_loc2_] = 16777215;
  42.          _loc2_ = _loc2_ + 1;
  43.          _loc3_ = _loc3_ + 1;
  44.       }
  45.       var _loc8_ = 0;
  46.       while(_loc8_ < _loc11_.groups.length)
  47.       {
  48.          var _loc5_ = 0;
  49.          while(_loc5_ < _loc11_.groups[_loc8_].contentList.length)
  50.          {
  51.             _loc3_ = 0;
  52.             while(_loc3_ < _loc4_)
  53.             {
  54.                if(_loc5_ != 0 && _loc3_ == 0 && _loc4_ == 4)
  55.                {
  56.                   _loc7_[_loc2_] = null;
  57.                }
  58.                else
  59.                {
  60.                   _loc7_[_loc2_] = 1;
  61.                }
  62.                _loc10_[_loc2_] = _loc12_["col" + _loc8_];
  63.                _loc2_ = _loc2_ + 1;
  64.                _loc3_ = _loc3_ + 1;
  65.             }
  66.             _loc5_ = _loc5_ + 1;
  67.          }
  68.          _loc8_ = _loc8_ + 1;
  69.       }
  70.       this.layout.setCellLayout(_loc7_);
  71.       if(_loc4_ == 4)
  72.       {
  73.          _loc7_ = [20,197,130,195];
  74.       }
  75.       else
  76.       {
  77.          _loc7_ = [197,151,195];
  78.       }
  79.       this.layout.setRowWidths(_loc7_);
  80.       _loc7_ = [18];
  81.       _loc3_ = 1;
  82.       while(_loc3_ < this.numberOfRows)
  83.       {
  84.          _loc7_[_loc3_] = 38;
  85.          _loc3_ = _loc3_ + 1;
  86.       }
  87.       this.layout.setColHeights(_loc7_);
  88.       this.layout.setColors(_loc10_);
  89.       this.gridLayout = new components.ui.gridLayout.GridLayout();
  90.       this.gridLayout.setLayout(this.layout);
  91.       this.gridLayout.setContainer(this);
  92.       var _loc9_ = this.gridLayout.render();
  93.       this.gridManager = new components.ui.gridLayout.core.GridManager();
  94.       this.gridManager.buildContent(_loc9_,this.layout,_loc11_);
  95.       var _loc14_ = new TextFormat();
  96.       _loc14_.font = _loc12_.font;
  97.       _loc14_.color = _loc12_.colorNormal;
  98.       _loc14_.size = 12;
  99.       _loc14_.align = "left";
  100.       var _loc15_ = this.attachMovie("disclaimback","disclaimback",1900);
  101.       _loc15_._x = 0;
  102.       var _loc13_ = 18;
  103.       _loc3_ = 1;
  104.       while(_loc3_ < 6)
  105.       {
  106.          _loc13_ += 39;
  107.          if(_loc3_ < this.numberOfRows)
  108.          {
  109.             var _loc6_ = this.attachMovie("more","btn" + _loc3_,19901 + _loc3_);
  110.             _loc6_._y = _loc9_[_loc3_][_loc4_ - 1].mc._y;
  111.             if(_loc9_[_loc3_][_loc4_ - 1].mc.content.tf1)
  112.             {
  113.                _loc6_._y += _loc9_[_loc3_][_loc4_ - 1].mc.content.tf1._y + _loc9_[_loc3_][_loc4_ - 1].mc.content._height - 15;
  114.             }
  115.             _loc6_._x = 515;
  116.             _loc6_.mark = _loc9_[_loc3_][_loc4_ - 2].mark;
  117.             _loc6_.param = _loc9_[_loc3_][_loc4_ - 2].param;
  118.             this.buildButton(_loc6_);
  119.             this.createFocusRec(_loc6_,29,15,0,0);
  120.             application.core.FocusManager.getInstance().registerButton(_loc6_,50 + _loc3_);
  121.          }
  122.          _loc3_ = _loc3_ + 1;
  123.       }
  124.       _loc15_._y = _loc13_;
  125.       if(_loc4_ == 4)
  126.       {
  127.          this.createTextField("tf",2000,24,213,508,30);
  128.       }
  129.       else
  130.       {
  131.          this.createTextField("tf",2000,4,213,528,30);
  132.       }
  133.       this.tf.embedFonts = true;
  134.       this.tf.wordWrap = true;
  135.       this.tf.multiline = true;
  136.       this.tf.border = false;
  137.       this.tf.html = true;
  138.       this.tf.selectable = false;
  139.       this.tf.htmlText = _loc11_.disclaim.content;
  140.       this.tf.setTextFormat(_loc14_);
  141.       if(this.tf.maxscroll > 1)
  142.       {
  143.          this.rootMC.showDisclaimScroll(this.tf);
  144.       }
  145.    }
  146.    function disable()
  147.    {
  148.       var _loc2_ = 1;
  149.       while(_loc2_ < this.numberOfRows)
  150.       {
  151.          this["btn" + _loc2_].onDisable();
  152.          _loc2_ = _loc2_ + 1;
  153.       }
  154.       this._visible = false;
  155.    }
  156.    function enable()
  157.    {
  158.       this.param = this.dataObj.client.contentList[this.activeSub].param;
  159.       this.contentMC.gotoAndStop(1);
  160.       var _loc2_ = 1;
  161.       while(_loc2_ < this.numberOfRows)
  162.       {
  163.          this["btn" + _loc2_].onEnable();
  164.          _loc2_ = _loc2_ + 1;
  165.       }
  166.       this.tf.scroll = 1;
  167.       if(this.tf.maxscroll > 1)
  168.       {
  169.          this.rootMC.showDisclaimScroll(this.tf);
  170.       }
  171.       this._visible = true;
  172.    }
  173.    function getParam()
  174.    {
  175.       return this.param;
  176.    }
  177.    function update(isHome)
  178.    {
  179.    }
  180.    function hide(isHome)
  181.    {
  182.    }
  183.    function onButtonRollOver(mc)
  184.    {
  185.    }
  186.    function onButtonRollOut(mc)
  187.    {
  188.    }
  189.    function onButtonPress(mc)
  190.    {
  191.    }
  192.    function onButtonRelease(mc)
  193.    {
  194.       this.contentMC._y = 0;
  195.       this.contentMC.gotoAndStop(mc.mark);
  196.       this.param = mc.param;
  197.       this.rootMC.onChangeRateContent(true);
  198.       this.disable();
  199.    }
  200.    function onButtonDisable(mc)
  201.    {
  202.    }
  203.    function onButtonEnable(mc)
  204.    {
  205.    }
  206.    function onButtonReleaseOutside(mc)
  207.    {
  208.    }
  209. }
  210.