home *** CD-ROM | disk | FTP | other *** search
- class application.screens.RateScreen extends application.screens.AbstractScreen implements application.models.IScreen
- {
- var activeSub;
- var contentMC;
- var layout;
- var param;
- var dataObj;
- var numberOfRows;
- var gridLayout;
- var gridManager;
- var tf;
- var rootMC;
- function RateScreen()
- {
- super();
- }
- function setActiveSub(activeSub)
- {
- this.activeSub = activeSub;
- }
- function setContentMC(contentMC)
- {
- this.contentMC = contentMC;
- }
- function build()
- {
- this.layout = new components.ui.gridLayout.data.LayoutData();
- this.param = this.dataObj.client.contentList[this.activeSub].param;
- var _loc11_ = this.dataObj.client.contentList[this.activeSub].rateContent;
- this.numberOfRows = _loc11_.contentsList.length;
- var _loc4_ = _loc11_.groups[0].name == null ? 3 : 4;
- this.layout.setGridLayout(this.numberOfRows,_loc4_,false,1,1,1);
- var _loc7_ = [];
- var _loc10_ = [];
- var _loc12_ = new components.ui.gridLayout.config.Config();
- var _loc2_ = 0;
- var _loc3_ = 0;
- while(_loc3_ < _loc4_)
- {
- _loc7_[_loc2_] = 1;
- _loc10_[_loc2_] = 16777215;
- _loc2_ = _loc2_ + 1;
- _loc3_ = _loc3_ + 1;
- }
- var _loc8_ = 0;
- while(_loc8_ < _loc11_.groups.length)
- {
- var _loc5_ = 0;
- while(_loc5_ < _loc11_.groups[_loc8_].contentList.length)
- {
- _loc3_ = 0;
- while(_loc3_ < _loc4_)
- {
- if(_loc5_ != 0 && _loc3_ == 0 && _loc4_ == 4)
- {
- _loc7_[_loc2_] = null;
- }
- else
- {
- _loc7_[_loc2_] = 1;
- }
- _loc10_[_loc2_] = _loc12_["col" + _loc8_];
- _loc2_ = _loc2_ + 1;
- _loc3_ = _loc3_ + 1;
- }
- _loc5_ = _loc5_ + 1;
- }
- _loc8_ = _loc8_ + 1;
- }
- this.layout.setCellLayout(_loc7_);
- if(_loc4_ == 4)
- {
- _loc7_ = [20,197,130,195];
- }
- else
- {
- _loc7_ = [197,151,195];
- }
- this.layout.setRowWidths(_loc7_);
- _loc7_ = [18];
- _loc3_ = 1;
- while(_loc3_ < this.numberOfRows)
- {
- _loc7_[_loc3_] = 38;
- _loc3_ = _loc3_ + 1;
- }
- this.layout.setColHeights(_loc7_);
- this.layout.setColors(_loc10_);
- this.gridLayout = new components.ui.gridLayout.GridLayout();
- this.gridLayout.setLayout(this.layout);
- this.gridLayout.setContainer(this);
- var _loc9_ = this.gridLayout.render();
- this.gridManager = new components.ui.gridLayout.core.GridManager();
- this.gridManager.buildContent(_loc9_,this.layout,_loc11_);
- var _loc14_ = new TextFormat();
- _loc14_.font = _loc12_.font;
- _loc14_.color = _loc12_.colorNormal;
- _loc14_.size = 12;
- _loc14_.align = "left";
- var _loc15_ = this.attachMovie("disclaimback","disclaimback",1900);
- _loc15_._x = 0;
- var _loc13_ = 18;
- _loc3_ = 1;
- while(_loc3_ < 6)
- {
- _loc13_ += 39;
- if(_loc3_ < this.numberOfRows)
- {
- var _loc6_ = this.attachMovie("more","btn" + _loc3_,19901 + _loc3_);
- _loc6_._y = _loc9_[_loc3_][_loc4_ - 1].mc._y;
- if(_loc9_[_loc3_][_loc4_ - 1].mc.content.tf1)
- {
- _loc6_._y += _loc9_[_loc3_][_loc4_ - 1].mc.content.tf1._y + _loc9_[_loc3_][_loc4_ - 1].mc.content._height - 15;
- }
- _loc6_._x = 515;
- _loc6_.mark = _loc9_[_loc3_][_loc4_ - 2].mark;
- _loc6_.param = _loc9_[_loc3_][_loc4_ - 2].param;
- this.buildButton(_loc6_);
- this.createFocusRec(_loc6_,29,15,0,0);
- application.core.FocusManager.getInstance().registerButton(_loc6_,50 + _loc3_);
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc15_._y = _loc13_;
- if(_loc4_ == 4)
- {
- this.createTextField("tf",2000,24,213,508,30);
- }
- else
- {
- this.createTextField("tf",2000,4,213,528,30);
- }
- this.tf.embedFonts = true;
- this.tf.wordWrap = true;
- this.tf.multiline = true;
- this.tf.border = false;
- this.tf.html = true;
- this.tf.selectable = false;
- this.tf.htmlText = _loc11_.disclaim.content;
- this.tf.setTextFormat(_loc14_);
- if(this.tf.maxscroll > 1)
- {
- this.rootMC.showDisclaimScroll(this.tf);
- }
- }
- function disable()
- {
- var _loc2_ = 1;
- while(_loc2_ < this.numberOfRows)
- {
- this["btn" + _loc2_].onDisable();
- _loc2_ = _loc2_ + 1;
- }
- this._visible = false;
- }
- function enable()
- {
- this.param = this.dataObj.client.contentList[this.activeSub].param;
- this.contentMC.gotoAndStop(1);
- var _loc2_ = 1;
- while(_loc2_ < this.numberOfRows)
- {
- this["btn" + _loc2_].onEnable();
- _loc2_ = _loc2_ + 1;
- }
- this.tf.scroll = 1;
- if(this.tf.maxscroll > 1)
- {
- this.rootMC.showDisclaimScroll(this.tf);
- }
- this._visible = true;
- }
- function getParam()
- {
- return this.param;
- }
- function update(isHome)
- {
- }
- function hide(isHome)
- {
- }
- function onButtonRollOver(mc)
- {
- }
- function onButtonRollOut(mc)
- {
- }
- function onButtonPress(mc)
- {
- }
- function onButtonRelease(mc)
- {
- this.contentMC._y = 0;
- this.contentMC.gotoAndStop(mc.mark);
- this.param = mc.param;
- this.rootMC.onChangeRateContent(true);
- this.disable();
- }
- function onButtonDisable(mc)
- {
- }
- function onButtonEnable(mc)
- {
- }
- function onButtonReleaseOutside(mc)
- {
- }
- }
-