home *** CD-ROM | disk | FTP | other *** search
- class com.argosy.ui.BreadcrumbMenu extends com.argosy.ui.baseUI
- {
- var menu_tf;
- var menu_items;
- var dispatchEvent;
- var normal_style;
- var bg;
- function BreadcrumbMenu()
- {
- super();
- }
- function clearContent()
- {
- this.menu_tf.htmlText = "";
- this.menu_items = [];
- }
- function setContent(menu_item)
- {
- this.clearContent();
- this.addMenuItem(menu_item);
- }
- function addMenuItem(menu_item)
- {
- var _loc3_ = {mc:menu_item,index:this.menu_items.length};
- this.menu_items.push(_loc3_);
- if(menu_item.type == "menu" && menu_item.parent != undefined)
- {
- this.addMenuItem(menu_item.parent);
- }
- else if(menu_item.type == "activity")
- {
- this.addMenuItem(menu_item._parent);
- }
- this.layout_menu();
- }
- function layout_menu()
- {
- var _loc3_ = "";
- var _loc2_ = 0;
- while(_loc2_ < this.menu_items.length)
- {
- if(_loc2_ > 0)
- {
- _loc3_ = "<a href=\'asfunction:link_press, " + this.menu_items[_loc2_].index + "\'>" + this.toTitleCaps(this.menu_items[_loc2_].mc.title) + "</a>" + " > " + _loc3_;
- }
- else
- {
- _loc3_ = this.toTitleCaps(this.menu_items[_loc2_].mc.title) + _loc3_;
- }
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = "<p>" + _loc3_ + "</p>";
- this.menu_tf.htmlText = _loc3_;
- }
- function link_press(id)
- {
- var _loc2_ = this.menu_items[Number(id)].mc;
- trace(["link_press",id,_loc2_]);
- this.dispatchEvent({type:"selection",target:_loc2_,type:_loc2_.type});
- }
- function init()
- {
- this.normal_style = new TextField.StyleSheet();
- this.normal_style.setStyle("p",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#1F3A70",textAlign:"left",textDecoration:"none",kerning:"true",letterSpacing:"0"});
- this.normal_style.setStyle("a:link",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#1F3A70"});
- this.normal_style.setStyle("a:hover",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#438CB8"});
- super.init();
- }
- function createChildren()
- {
- this.bg = this.createEmptyMovieClip("bg",1);
- this.menu_tf = this.createTextField("menu_tf",2,25,2,this.width - 50,20);
- this.menu_tf.selectable = false;
- this.menu_tf.html = true;
- this.menu_tf.embedFonts = true;
- this.menu_tf.autoSize = true;
- this.menu_tf.styleSheet = this.normal_style;
- }
- function layout()
- {
- this.bg.clear();
- this.bg.lineStyle(0,16711680,0);
- this.bg.beginFill(16777215,0);
- this.bg.lineTo(this.width,0);
- this.bg.lineTo(this.width,this.height);
- this.bg.lineTo(0,this.height);
- this.bg.lineTo(0,0);
- this.bg.endFill();
- this.menu_tf._width = this.width;
- this.menu_tf._height = this.height;
- }
- function disableHover()
- {
- trace("disable hover");
- this.normal_style.setStyle("a:hover",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#1F3A70"});
- var _loc2_ = 0;
- while(_loc2_ < this.menu_items.length)
- {
- this.menu_items[_loc2_].mc.label_tf.styleSheet = this.normal_style;
- _loc2_ = _loc2_ + 1;
- }
- }
- function enableHover()
- {
- trace("enable hover");
- this.normal_style.setStyle("a:hover",{fontFamily:"Frutiger Bold",fontSize:"12",color:"#438CB8"});
- var _loc2_ = 0;
- while(_loc2_ < this.menu_items.length)
- {
- this.menu_items[_loc2_].mc.label_tf.styleSheet = this.normal_style;
- _loc2_ = _loc2_ + 1;
- }
- }
- }
-