home *** CD-ROM | disk | FTP | other *** search
- class application.screens.HorizontalSubNavigation 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 btn0;
- var activeButton;
- function HorizontalSubNavigation()
- {
- 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()
- {
- if(this.activeMain == 9)
- {
- var _loc4_ = this.dataObj.imprint.contentList;
- }
- else if(this.activeMain == 11)
- {
- _loc4_ = this.dataObj.help.contentList;
- }
- else
- {
- _loc4_ = this.dataObj.content[this.activeMain].contentList;
- }
- var _loc5_ = null;
- var _loc3_ = 0;
- while(_loc3_ < _loc4_.length - 1)
- {
- var _loc2_ = this.createEmptyMovieClip("btn" + _loc3_,this.instCounter++);
- if(_loc3_ == 0)
- {
- this.buildFirstButtonGfx(_loc2_);
- var _loc6_ = this.buildLabelGfx(_loc2_,_loc4_[_loc3_ + 1].label);
- this.resizeButton(_loc2_,_loc6_);
- }
- else if(_loc3_ == _loc4_.length - 2)
- {
- this.buildLastButtonGfx(_loc2_);
- _loc6_ = this.buildLabelGfx(_loc2_,_loc4_[_loc3_ + 1].label);
- this.resizeButton(_loc2_,_loc6_);
- }
- else
- {
- this.buildButtonGfx(_loc2_);
- _loc6_ = this.buildLabelGfx(_loc2_,_loc4_[_loc3_ + 1].label);
- this.resizeButton(_loc2_,_loc6_);
- }
- if(_loc3_ != 1)
- {
- _loc2_._x = _loc5_._x + _loc5_._width - 1;
- }
- else
- {
- _loc2_._x = _loc5_._x + _loc5_._width - 5;
- }
- this.buildButton(_loc2_);
- _loc2_.mainId = this.activeMain;
- _loc2_.subId = _loc3_ + 1;
- if(_loc3_ == 0)
- {
- this.createFocusRec(_loc2_,_loc2_._width - 7,_loc2_._height - 2,1,1);
- }
- else
- {
- this.createFocusRec(_loc2_,_loc2_._width - 4,_loc2_._height - 2,1,1);
- }
- if(this.activeMain == 9 || this.activeMain == 11)
- {
- application.core.FocusManager.getInstance().registerButton(_loc2_,10 + (_loc3_ + 1));
- }
- else
- {
- application.core.FocusManager.getInstance().registerButton(_loc2_,10 * (this.activeMain + 1) + (_loc3_ + 1));
- }
- _loc5_ = _loc2_;
- _loc3_ = _loc3_ + 1;
- }
- }
- function onButtonRollOver(mc)
- {
- }
- function onButtonRollOut(mc)
- {
- }
- function onButtonPress(mc)
- {
- }
- function onButtonRelease(mc)
- {
- if(mc._parent != this.active)
- {
- this.rootMC.update(2,mc.mainId,mc.subId);
- }
- }
- function onButtonDisable(mc)
- {
- }
- function onButtonEnable(mc)
- {
- }
- function buildFirstButtonGfx(mc)
- {
- var _loc1_ = 0;
- var _loc3_ = mc.attachMovie("inactive_first_left","left",1);
- _loc1_ = 10;
- _loc3_ = mc.attachMovie("inactive_center","center",2);
- _loc3_._x = _loc1_;
- _loc1_ += mc.center._width;
- _loc3_ = mc.attachMovie("inactive_right","right",3);
- _loc3_._x = _loc1_;
- }
- function buildLastButtonGfx(mc)
- {
- var _loc1_ = 0;
- var _loc3_ = mc.attachMovie("inactive_left","left",1);
- _loc1_ = 10;
- _loc3_ = mc.attachMovie("inactive_center","center",2);
- _loc3_._x = _loc1_;
- _loc1_ += mc.center._width;
- _loc3_ = mc.attachMovie("inactive_last_right","right",3);
- _loc3_._x = _loc1_;
- }
- function buildButtonGfx(mc)
- {
- var _loc1_ = 0;
- var _loc3_ = mc.attachMovie("inactive_left","left",1);
- _loc1_ = 10;
- _loc3_ = mc.attachMovie("inactive_center","center",2);
- _loc3_._x = _loc1_;
- _loc1_ += mc.center._width;
- _loc3_ = mc.attachMovie("inactive_right","right",3);
- _loc3_._x = _loc1_;
- }
- function buildActiveButtonGfx(mc)
- {
- var _loc1_ = 0;
- var _loc3_ = mc.attachMovie("active_left","left",2);
- _loc1_ = 10;
- _loc3_ = mc.attachMovie("active_center","center",3);
- _loc3_._x = _loc1_;
- _loc1_ += mc.center._width;
- _loc3_ = mc.attachMovie("active_right","right",4);
- _loc3_._x = _loc1_;
- }
- function buildLabelGfx(mc, labelText)
- {
- mc.createTextField("tf",6,8,0,100,22);
- var _loc2_ = mc.tf;
- _loc2_.autoSize = true;
- _loc2_.embedFonts = true;
- _loc2_.text = labelText;
- _loc2_.selectable = false;
- _loc2_.setTextFormat(this.format);
- return _loc2_.textWidth;
- }
- function resizeButton(mc, width)
- {
- mc.center._width = width;
- mc.right._x = mc.center._x + width;
- }
- function showActiveButton()
- {
- if(this.activeMain == 9)
- {
- var _loc6_ = this.dataObj.imprint.contentList;
- }
- else if(this.activeMain == 11)
- {
- _loc6_ = this.dataObj.help.contentList;
- }
- else
- {
- _loc6_ = this.dataObj.content[this.activeMain].contentList;
- }
- btn._x = 0;
- var btn = this.btn0;
- btn._x = 0;
- var _loc2_ = btn;
- var _loc3_ = 1;
- while(_loc3_ < this.activeSub)
- {
- btn = this["btn" + _loc3_];
- btn._x = _loc2_._x + _loc2_._width;
- if(_loc3_ == 1)
- {
- btn._x -= 5;
- }
- else
- {
- btn._x -= 1;
- }
- _loc2_ = btn;
- _loc3_ = _loc3_ + 1;
- }
- this.activeButton._visible = true;
- this.activeButton.onEnable();
- this.active.removeMovieClip();
- var _loc4_ = this.createEmptyMovieClip("active",this.instCounter++);
- this.activeButton = this["btn" + (this.activeSub - 1)];
- this.activeButton.onDisable();
- this.activeButton._visible = false;
- this.buildActiveButtonGfx(_loc4_);
- _loc4_.createTextField("tf",7,8,0,100,22);
- var _loc5_ = _loc4_.tf;
- _loc5_.autoSize = true;
- _loc5_.embedFonts = true;
- _loc5_.text = _loc6_[this.activeSub].label;
- _loc5_.selectable = false;
- _loc5_.setTextFormat(this.format1);
- _loc5_.textWidth;
- var _loc8_ = _loc5_.textWidth;
- _loc4_.tf._y += 4;
- this.resizeButton(_loc4_,_loc8_);
- _loc4_._x = this.activeButton._x;
- _loc4_._y = this.activeButton._y - 5;
- if(this.activeSub != 1)
- {
- var _loc7_ = _loc4_.attachMovie("inactive_center","hider",1);
- _loc7_._width = 5;
- _loc7_._x = - _loc7_._width;
- _loc7_._y = 5;
- }
- _loc4_.left.onRollOver = function()
- {
- };
- _loc4_.left.useHandCursor = false;
- _loc4_.center.onRollOver = function()
- {
- };
- _loc4_.center.useHandCursor = false;
- _loc4_.right.onRollOver = function()
- {
- };
- _loc4_.right.useHandCursor = false;
- btn = this["btn" + this.activeSub];
- btn._x = this.active._x + this.active._width - 8;
- _loc2_ = btn;
- _loc3_ = this.activeSub + 1;
- while(_loc3_ < _loc6_.length - 1)
- {
- btn = this["btn" + _loc3_];
- btn._x = _loc2_._x + _loc2_._width;
- if(_loc3_ == 1)
- {
- btn._x -= 5;
- }
- else
- {
- btn._x -= 1;
- }
- _loc2_ = btn;
- _loc3_ = _loc3_ + 1;
- }
- }
- function hideActiveButton()
- {
- this.activeButton._visible = true;
- this.activeButton.onEnable();
- this.active.removeMovieClip();
- if(this.activeMain == 9)
- {
- var _loc5_ = this.dataObj.imprint.contentList;
- }
- else if(this.activeMain == 11)
- {
- _loc5_ = this.dataObj.help.contentList;
- }
- else
- {
- _loc5_ = this.dataObj.content[this.activeMain].contentList;
- }
- var _loc3_ = this.btn0;
- _loc3_._x = 0;
- var _loc4_ = _loc3_;
- var _loc2_ = 1;
- while(_loc2_ < _loc5_.length)
- {
- _loc3_ = this["btn" + _loc2_];
- _loc3_._x = _loc4_._x + _loc4_._width;
- if(_loc2_ == 1)
- {
- _loc3_._x -= 5;
- }
- else
- {
- _loc3_._x -= 1;
- }
- _loc4_ = _loc3_;
- _loc2_ = _loc2_ + 1;
- }
- }
- function onButtonReleaseOutside(mc)
- {
- }
- }
-