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

  1. package mx.core
  2. {
  3.    import flash.display.InteractiveObject;
  4.    import mx.managers.IFocusManager;
  5.    
  6.    public class ContainerGlobals
  7.    {
  8.       public static var focusedContainer:InteractiveObject;
  9.       
  10.       public function ContainerGlobals()
  11.       {
  12.          super();
  13.       }
  14.       
  15.       public static function checkFocus(param1:InteractiveObject, param2:InteractiveObject) : void
  16.       {
  17.          var _loc6_:IFocusManager = null;
  18.          var _loc7_:IButton = null;
  19.          var _loc3_:InteractiveObject = param2;
  20.          var _loc4_:InteractiveObject = param2;
  21.          var _loc5_:IUIComponent = null;
  22.          if(param2 != null && param1 == param2)
  23.          {
  24.             return;
  25.          }
  26.          while(_loc4_)
  27.          {
  28.             if(_loc4_.parent)
  29.             {
  30.                _loc3_ = _loc4_.parent;
  31.             }
  32.             else
  33.             {
  34.                _loc3_ = null;
  35.             }
  36.             if(_loc4_ is IUIComponent)
  37.             {
  38.                _loc5_ = IUIComponent(_loc4_);
  39.             }
  40.             _loc4_ = _loc3_;
  41.             if((_loc4_) && _loc4_ is IContainer && Boolean(IContainer(_loc4_).defaultButton))
  42.             {
  43.                break;
  44.             }
  45.          }
  46.          if(ContainerGlobals.focusedContainer != _loc4_ || ContainerGlobals.focusedContainer == null && _loc4_ == null)
  47.          {
  48.             if(!_loc4_)
  49.             {
  50.                _loc4_ = InteractiveObject(_loc5_);
  51.             }
  52.             if(Boolean(_loc4_) && _loc4_ is IContainer)
  53.             {
  54.                _loc6_ = IContainer(_loc4_).focusManager;
  55.                if(!_loc6_)
  56.                {
  57.                   return;
  58.                }
  59.                _loc7_ = IContainer(_loc4_).defaultButton as IButton;
  60.                if(_loc7_)
  61.                {
  62.                   ContainerGlobals.focusedContainer = InteractiveObject(_loc4_);
  63.                   _loc6_.defaultButton = _loc7_ as IButton;
  64.                }
  65.                else
  66.                {
  67.                   ContainerGlobals.focusedContainer = InteractiveObject(_loc4_);
  68.                   _loc6_.defaultButton = null;
  69.                }
  70.             }
  71.          }
  72.       }
  73.    }
  74. }
  75.  
  76.