home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / sky-chopper.swf / scripts / __Packages / mx / controls / menuclasses / MenuDataProvider.as < prev    next >
Encoding:
Text File  |  2005-09-29  |  1.7 KB  |  62 lines

  1. class mx.controls.menuclasses.MenuDataProvider extends Object
  2. {
  3.    var addTreeNode;
  4.    var addTreeNodeAt;
  5.    var removeTreeNode;
  6.    var getTreeNodeAt;
  7.    var childNodes;
  8.    static var mixinProps = ["addMenuItem","addMenuItemAt","getMenuItemAt","removeMenuItem","removeMenuItemAt","normalize","indexOf"];
  9.    static var mixins = new mx.controls.menuclasses.MenuDataProvider();
  10.    function MenuDataProvider()
  11.    {
  12.       super();
  13.    }
  14.    static function Initialize(obj)
  15.    {
  16.       obj = obj.prototype;
  17.       var _loc3_ = mx.controls.menuclasses.MenuDataProvider.mixinProps;
  18.       var _loc5_ = _loc3_.length;
  19.       var _loc2_ = 0;
  20.       while(_loc2_ < _loc5_)
  21.       {
  22.          obj[_loc3_[_loc2_]] = mx.controls.menuclasses.MenuDataProvider.mixins[_loc3_[_loc2_]];
  23.          _global.ASSetPropFlags(obj,_loc3_[_loc2_],1);
  24.          _loc2_ = _loc2_ + 1;
  25.       }
  26.       return true;
  27.    }
  28.    function addMenuItem(arg)
  29.    {
  30.       return this.addTreeNode(mx.controls.treeclasses.TreeDataProvider.convertToNode("menuitem",arg));
  31.    }
  32.    function addMenuItemAt(index, arg)
  33.    {
  34.       return this.addTreeNodeAt(index,mx.controls.treeclasses.TreeDataProvider.convertToNode("menuitem",arg));
  35.    }
  36.    function removeMenuItem(Void)
  37.    {
  38.       return this.removeTreeNode();
  39.    }
  40.    function removeMenuItemAt(index)
  41.    {
  42.       return this.getTreeNodeAt(index).removeTreeNode();
  43.    }
  44.    function getMenuItemAt(index)
  45.    {
  46.       return this.getTreeNodeAt(index);
  47.    }
  48.    function indexOf(item)
  49.    {
  50.       var _loc2_ = 0;
  51.       while(_loc2_ < this.childNodes.length)
  52.       {
  53.          if(this.childNodes[_loc2_] == item)
  54.          {
  55.             return _loc2_;
  56.          }
  57.          _loc2_ = _loc2_ + 1;
  58.       }
  59.       return undefined;
  60.    }
  61. }
  62.