class mx.controls.TabBar extends mx.core.View { var tabChildren, tabEnabled, length, _selectedIndex, selectedIndex, __labels, data, setDataProvider, dataProvider, __get__width, tabContent, createEmptyMovieClip, oldIndex, enabled, __get__tabSymbol, __get__height, setFocus, redraw, dispatchEvent, invalidate, __labelPlacement, __get__labelPlacement, __icons, __get__icons, __get__iconField, removeAll, __set__iconField, __set__icons, __set__labelPlacement, __set__tabSymbol; function TabBar() { super(); } // End of the function function init(Void) { super.init(); tabChildren = false; tabEnabled = true; this.populateFromParams(); if (length > 0) { selectedIndex = _selectedIndex; } // end if } // End of the function function populateFromParams() { var _loc6 = new Array(); if (__labels.length > 0) { for (var _loc2 = 0; _loc2 < __labels.length; ++_loc2) { _loc6.addItem({label: __labels[_loc2], data: data[_loc2], icon: icons[_loc2]}); } // end of for } // end if this.setDataProvider(_loc6); } // End of the function function size() { super.size(); var _loc10 = dataProvider.length; var _loc11 = this.__get__width() / _loc10; tabContent.removeMovieClip(); tabContent = this.createEmptyMovieClip("content_mc", CONTENTDEPTH); var _loc9 = 0; if (selectedIndex == undefined && length > 0) { selectedIndex = oldIndex; this.fireChange(true); } else { this.fireChange(); } // end else if for (var _loc4 = 0; _loc4 < _loc10; ++_loc4) { var _loc6 = dataProvider.getItemAt(_loc4); var _loc8 = selectedIndex == _loc4; var _loc3 = new Object(); _loc3.owner = this; _loc3.styleName = this; _loc3.itemIndex = _loc4; _loc3.item = _loc6; _loc3.sel = selectedIndex == _loc4; _loc3.label = _loc6[labelField]; var _loc7 = _loc6[iconField]; if (_loc7 != undefined) { _loc3.icon = _loc7; } // end if _loc3.selected = _loc8; _loc3.enabled = enabled; _loc3.labelPlacement = labelPlacement; var _loc5 = tabContent.createObject(this.__get__tabSymbol(), "tabItem" + tabTracker++, _loc4, _loc3); _loc5.setSize(_loc11, this.__get__height()); _loc5.redraw(); _loc5.move(_loc9, 0); _loc5.addEventListener("click", this); _loc9 = _loc9 + _loc5.width; } // end of for } // End of the function function click(eventObj) { this.fireChange(); this.setFocus(); this.redraw(); } // End of the function function fireChange(ignore) { var _loc2 = selectedIndex; if (oldIndex != _loc2 || ignore) { this.dispatchEvent({newIndex: _loc2, oldIndex: oldIndex, type: "change"}); oldIndex = _loc2; } // end if } // End of the function function set tabSymbol(symb) { __tabSymbol = symb; this.invalidate(); //return (this.tabSymbol()); null; } // End of the function function get tabSymbol() { return (__tabSymbol); } // End of the function function get labelPlacement() { return (__labelPlacement); } // End of the function function set labelPlacement(str) { __labelPlacement = str; this.invalidate(); //return (this.labelPlacement()); null; } // End of the function function getTab(index) { return (tabContent["tabItem" + index]); } // End of the function function set icons(arr) { __icons = arr; this.invalidate(); //return (this.icons()); null; } // End of the function function get icons() { return (__icons); } // End of the function function set iconField(field) { __iconField = field; this.invalidate(); //return (this.iconField()); null; } // End of the function function get iconField() { return (__iconField); } // End of the function function keyDown(e) { if (e.code == 39) { this.moveSelBy(1); } else if (e.code == 37) { this.moveSelBy(-1); } // end else if } // End of the function function moveSelBy(amount) { selectedIndex = selectedIndex + amount; this.fireChange(); } // End of the function function onUpdate() { if (__labels.length > 0) { var _loc3 = new Array(); for (var _loc2 = 0; _loc2 < __labels.length; ++_loc2) { if (icons[_loc2] != undefined) { _loc3.addItem({label: __labels[_loc2], icon: "mx.controls.TabIcon", data: data[_loc2]}); continue; } // end if _loc3.addItem({label: __labels[_loc2], data: data[_loc2]}); } // end of for this.setDataProvider(_loc3); } else { this.removeAll(); } // end else if selectedIndex = _selectedIndex; } // End of the function static var symbolName = "mx.controls.TabBar"; static var symbolOwner = mx.controls.TabBar; var className = "mx.controls.TabBar"; static var version = "1.0.8"; static var mixIt1 = mx.controls.listclasses.DataSelector.Initialize(mx.controls.TabBar); static var mixIt2 = mx.controls.listclasses.DataProvider.Initialize(Array); var multipleSelection = false; var labelField = "label"; var __tabSymbol = "mx.controls.Tab"; var __iconField = "icon"; var CONTENTDEPTH = 100; var useHandCursor = false; var tabTracker = 0; } // End of Class