home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / mx / controls / listClasses / ListItemDragProxy.as < prev    next >
Encoding:
Text File  |  2010-06-23  |  2.6 KB  |  78 lines

  1. package mx.controls.listClasses
  2. {
  3.    import flash.display.DisplayObject;
  4.    import mx.core.UIComponent;
  5.    import mx.core.mx_internal;
  6.    
  7.    use namespace mx_internal;
  8.    
  9.    public class ListItemDragProxy extends UIComponent
  10.    {
  11.       mx_internal static const VERSION:String = "3.5.0.12683";
  12.       
  13.       public function ListItemDragProxy()
  14.       {
  15.          super();
  16.       }
  17.       
  18.       override protected function createChildren() : void
  19.       {
  20.          var _loc4_:IListItemRenderer = null;
  21.          var _loc5_:IListItemRenderer = null;
  22.          var _loc6_:ListBaseContentHolder = null;
  23.          var _loc7_:BaseListData = null;
  24.          super.createChildren();
  25.          var _loc1_:Array = ListBase(owner).selectedItems;
  26.          var _loc2_:int = int(_loc1_.length);
  27.          var _loc3_:int = 0;
  28.          while(_loc3_ < _loc2_)
  29.          {
  30.             _loc4_ = ListBase(owner).itemToItemRenderer(_loc1_[_loc3_]);
  31.             if(_loc4_)
  32.             {
  33.                _loc5_ = ListBase(owner).createItemRenderer(_loc1_[_loc3_]);
  34.                _loc5_.styleName = ListBase(owner);
  35.                if(_loc5_ is IDropInListItemRenderer)
  36.                {
  37.                   _loc7_ = IDropInListItemRenderer(_loc4_).listData;
  38.                   IDropInListItemRenderer(_loc5_).listData = !!_loc1_[_loc3_] ? _loc7_ : null;
  39.                }
  40.                _loc5_.data = _loc1_[_loc3_];
  41.                addChild(DisplayObject(_loc5_));
  42.                _loc6_ = _loc4_.parent as ListBaseContentHolder;
  43.                _loc5_.setActualSize(_loc4_.width,_loc4_.height);
  44.                _loc5_.x = _loc4_.x + _loc6_.leftOffset;
  45.                _loc5_.y = _loc4_.y + _loc6_.topOffset;
  46.                measuredHeight = Math.max(measuredHeight,_loc5_.y + _loc5_.height);
  47.                measuredWidth = Math.max(measuredWidth,_loc5_.x + _loc5_.width);
  48.                _loc5_.visible = true;
  49.             }
  50.             _loc3_++;
  51.          }
  52.          invalidateDisplayList();
  53.       }
  54.       
  55.       override protected function measure() : void
  56.       {
  57.          var _loc3_:IListItemRenderer = null;
  58.          super.measure();
  59.          var _loc1_:Number = 0;
  60.          var _loc2_:Number = 0;
  61.          var _loc4_:int = 0;
  62.          while(_loc4_ < numChildren)
  63.          {
  64.             _loc3_ = getChildAt(_loc4_) as IListItemRenderer;
  65.             if(_loc3_)
  66.             {
  67.                _loc1_ = Math.max(_loc1_,_loc3_.x + _loc3_.width);
  68.                _loc2_ = Math.max(_loc2_,_loc3_.y + _loc3_.height);
  69.             }
  70.             _loc4_++;
  71.          }
  72.          measuredWidth = measuredMinWidth = _loc1_;
  73.          measuredHeight = measuredMinHeight = _loc2_;
  74.       }
  75.    }
  76. }
  77.  
  78.