home *** CD-ROM | disk | FTP | other *** search
- class application.screens.TreeSubNavigation extends application.screens.AbstractScreen implements application.models.IScreen
- {
- var instCounter;
- var format;
- var format1;
- var activeMain;
- var activeSub;
- var dataObj;
- var active;
- var rootMC;
- var activeButton;
- function TreeSubNavigation()
- {
- super();
- this.instCounter = 1;
- this.format = new TextFormat();
- this.format.align = "left";
- this.format.color = 0;
- this.format.font = "Tele-GroteskNor";
- this.format.leading = 2;
- this.format.size = 18;
- this.format1 = new TextFormat();
- this.format1.align = "left";
- this.format1.color = 3633064;
- this.format1.font = "Tele-GroteskFet";
- this.format1.leading = 2;
- this.format1.size = 18;
- }
- function setAciveContent(activeMain, activeSub)
- {
- this.activeMain = activeMain;
- this.activeSub = activeSub;
- }
- function update(activeSub)
- {
- this.activeSub = activeSub;
- if(activeSub != 0)
- {
- this.showActiveButton();
- }
- else
- {
- this.hideActiveButton();
- }
- }
- function build()
- {
- var _loc3_ = this.dataObj.client.contentList;
- var _loc5_ = 170;
- var _loc4_ = null;
- var _loc2_ = 0;
- while(_loc2_ < _loc3_.length - 1)
- {
- var _loc6_ = this.createEmptyMovieClip("btn" + _loc2_,this.instCounter++);
- this.buildButtonGfx(_loc6_,_loc5_);
- this.buildLabelGfx(_loc6_,_loc3_[_loc2_ + 1].label);
- if(!_loc3_[_loc2_ + 1].isMain)
- {
- _loc6_.tf._x += 14;
- }
- if(_loc2_ != 0)
- {
- _loc6_._y = _loc4_._y + 24;
- }
- if(_loc3_[_loc2_ + 1].site != null)
- {
- this.buildButton(_loc6_);
- _loc6_.mainId = this.activeMain;
- _loc6_.subId = _loc2_ + 1;
- if(_loc2_ == 0)
- {
- this.createFocusRec(_loc6_,_loc6_._width - 1,_loc6_._height - 5,_loc6_._x,1);
- }
- else
- {
- this.createFocusRec(_loc6_,_loc6_._width - 1,_loc6_._height - 4,_loc6_._x,0);
- }
- application.core.FocusManager.getInstance().registerButton(_loc6_,_loc2_ + 10);
- }
- _loc4_ = _loc6_;
- _loc2_ = _loc2_ + 1;
- }
- _loc6_ = this.attachMovie("verticalSubNavigation_lastpice","lastpice",this.instCounter++);
- var _loc7_ = (_loc3_.length - 1) * 24;
- _loc6_._width = _loc5_;
- _loc6_._height = 302 - _loc7_;
- _loc6_._y = _loc7_;
- }
- function onButtonRollOver(mc)
- {
- }
- function onButtonRollOut(mc)
- {
- }
- function onButtonPress(mc)
- {
- }
- function onButtonRelease(mc)
- {
- if(mc._parent != this.active)
- {
- this.rootMC.update(3,mc.mainId,mc.subId);
- }
- }
- function onButtonDisable(mc)
- {
- }
- function onButtonEnable(mc)
- {
- }
- function buildButtonGfx(mc, btnWidth)
- {
- var _loc1_ = mc.attachMovie("verticalSubNavigation_inactive","btn",1);
- _loc1_._width = btnWidth;
- _loc1_.gotoAndStop(1);
- }
- function buildActiveButtonGfx(mc, btnWidth)
- {
- var _loc2_ = null;
- if(this.activeSub != 1)
- {
- _loc2_ = mc.attachMovie("verticalSubNavigation_active","btn",2);
- }
- else
- {
- _loc2_ = mc.attachMovie("verticalSubNavigation_first_active","btn",2);
- }
- _loc2_._width = btnWidth;
- }
- function buildLabelGfx(mc, labelText)
- {
- mc.createTextField("tf",6,13,-1,100,22);
- var _loc2_ = mc.tf;
- _loc2_.autoSize = true;
- _loc2_.embedFonts = true;
- _loc2_.text = labelText;
- _loc2_.selectable = false;
- _loc2_.setTextFormat(this.format);
- }
- function showActiveButton()
- {
- var _loc4_ = this.dataObj.client.contentList;
- var _loc5_ = 170;
- this.activeButton._visible = true;
- this.activeButton.onEnable();
- this.active.removeMovieClip();
- var _loc2_ = this.createEmptyMovieClip("active",this.instCounter++);
- this.activeButton = this["btn" + (this.activeSub - 1)];
- _loc2_._x = this.activeButton._x;
- if(this.activeSub != 1)
- {
- _loc2_._y = this.activeButton._y - 2;
- }
- else
- {
- _loc2_._y = this.activeButton._y;
- }
- this.activeButton.onDisable();
- this.activeButton._visible = false;
- this.buildActiveButtonGfx(_loc2_,_loc5_);
- var _loc6_ = this.activeButton.tf.textWidth;
- _loc2_.createTextField("tf",6,13,-1,100,22);
- var _loc3_ = _loc2_.tf;
- _loc3_.autoSize = true;
- _loc3_.embedFonts = true;
- _loc3_.text = _loc4_[this.activeSub].label;
- _loc3_.selectable = false;
- _loc3_.setTextFormat(this.format1);
- if(this.activeSub != 1)
- {
- _loc3_._y += 2;
- }
- _loc2_.btn.useHandCursor = false;
- _loc2_.btn.onRollOver = function()
- {
- };
- }
- function hideActiveButton()
- {
- this.activeButton._visible = true;
- this.activeButton.onEnable();
- this.active.removeMovieClip();
- }
- function onButtonReleaseOutside(mc)
- {
- }
- }
-