home *** CD-ROM | disk | FTP | other *** search
- class application.screens.HomeScreen extends application.screens.AbstractScreen implements application.models.IScreen
- {
- var controller;
- var dataObj;
- var systemObj;
- var configObj;
- var banner0;
- var banner1;
- function HomeScreen()
- {
- super();
- }
- function build()
- {
- var _loc5_ = 0;
- while(_loc5_ < 4)
- {
- var _loc2_ = this["menu" + _loc5_];
- _loc2_.background.controller = this;
- _loc2_.background.useHandCursor = false;
- _loc2_.background.mainId = _loc5_;
- _loc2_.background.subId = 0;
- _loc2_.background.onRelease = function()
- {
- this.controller.onButtonRelease(this);
- };
- _loc2_.headline.text = this.dataObj.content[_loc5_].headline;
- Object.registerClass("dummy",application.ui.PicLoader);
- var _loc7_ = application.ui.PicLoader(_loc2_.attachMovie("dummy","pic" + _loc5_,100));
- _loc7_._x = 3;
- _loc7_._y = 2;
- _loc7_.loadPic(this.dataObj.content[_loc5_].picture,170,110,"left");
- this.buildButton(_loc2_.btn);
- _loc2_.btn.mainId = _loc5_;
- _loc2_.btn.subId = 0;
- this.createFocusRec(_loc2_.btn,_loc2_.btn._width,_loc2_.btn._height,0,0);
- application.core.FocusManager.getInstance().registerButton(_loc2_.btn,10 * (_loc5_ + 1));
- var _loc4_ = 0;
- while(_loc4_ < this.dataObj.content[_loc5_].contentList.length - 1)
- {
- var _loc6_ = this.dataObj.content[_loc5_].contentList[_loc4_ + 1];
- this.buildButton(_loc2_["btn" + _loc4_]);
- _loc2_["btn" + _loc4_].mainId = _loc5_;
- _loc2_["btn" + _loc4_].subId = _loc4_ + 1;
- this.setLabel(_loc2_["btn" + _loc4_],_loc6_.label,true);
- var _loc3_ = _loc2_["btn" + _loc4_].btnbackground;
- this.reszizeButtonBackground(_loc3_,_loc2_["btn" + _loc4_].label._width + 6,_loc3_._height);
- this.createFocusRec(_loc2_["btn" + _loc4_],_loc3_._width + 2,_loc3_._height,-1,_loc3_._y - 1);
- application.core.FocusManager.getInstance().registerButton(_loc2_["btn" + _loc4_],10 * (_loc5_ + 1) + (_loc4_ + 1));
- _loc4_ = _loc4_ + 1;
- }
- if(this.dataObj.content[_loc5_].contentList.length - 1 < 5)
- {
- _loc4_ = 4;
- while(_loc4_ >= this.dataObj.content[_loc5_].contentList.length - 1)
- {
- _loc2_["btn" + _loc4_].gotoAndStop(1);
- _loc2_["btn" + _loc4_]._visible = false;
- _loc4_ = _loc4_ - 1;
- }
- }
- _loc5_ = _loc5_ + 1;
- }
- if(this.systemObj.isWinXP)
- {
- _loc5_ = 0;
- while(_loc5_ < 2)
- {
- _loc3_ = this["banner" + _loc5_];
- this.buildButton(_loc3_.background);
- _loc3_.background.useHandCursor = false;
- _loc3_.background.mainId = 4 + _loc5_;
- _loc3_.background.subId = 0;
- _loc3_.gotoAndStop(1);
- this.buildButton(_loc3_.btn);
- _loc3_.btn.mainId = 4 + _loc5_;
- _loc3_.btn.subId = 0;
- this.setLabel(_loc3_,this.configObj.textList["banner" + _loc5_],false);
- this.createFocusRec(_loc3_.btn,34,34,1,1);
- application.core.FocusManager.getInstance().registerButton(_loc3_.btn,50 + _loc5_);
- _loc5_ = _loc5_ + 1;
- }
- }
- else
- {
- this.buildButton(this.banner0.background);
- this.banner0.background.useHandCursor = false;
- this.banner0.background.mainId = 4;
- this.banner0.background.subId = 0;
- this.banner0.gotoAndStop(2);
- this.buildButton(this.banner0.btn);
- this.banner0.btn.mainId = 4;
- this.banner0.btn.subId = 0;
- this.setLabel(this.banner0,this.configObj.textList.bannerNoneXP,false);
- this.createFocusRec(this.banner0.btn,34,34,1,1);
- application.core.FocusManager.getInstance().registerButton(this.banner0.btn,50);
- this.banner1.gotoAndStop(1);
- this.banner1._visible = false;
- }
- }
- function onButtonRollOver(mc)
- {
- mc.label.textColor = 14418032;
- }
- function onButtonRollOut(mc)
- {
- mc.label.textColor = 0;
- }
- function onButtonPress(mc)
- {
- }
- function onButtonRelease(mc)
- {
- if(mc != this.banner0.btn && mc != this.banner0.background && mc != this.banner1.background && mc != this.banner1.btn)
- {
- application.core.ContentManager.getInstance().showContent(2,mc.mainId,mc.subId);
- }
- else
- {
- application.core.ContentManager.getInstance().showContent(3,mc.mainId,mc.subId);
- }
- }
- function onButtonDisable(mc)
- {
- }
- function onButtonEnable(mc)
- {
- }
- function onButtonReleaseOutside(mc)
- {
- mc.label.textColor = 0;
- }
- }
-