home *** CD-ROM | disk | FTP | other *** search
/ Micromanía: 150 Juegos 2010 / 150Juegos_16.iso / Shareware / Shape Smash / shape-smash.swf / scripts / mx / managers / SystemManager.as < prev    next >
Encoding:
Text File  |  2010-05-14  |  46.9 KB  |  1,525 lines

  1. package mx.managers
  2. {
  3.    import flash.display.DisplayObject;
  4.    import flash.display.DisplayObjectContainer;
  5.    import flash.display.Graphics;
  6.    import flash.display.InteractiveObject;
  7.    import flash.display.Loader;
  8.    import flash.display.MovieClip;
  9.    import flash.display.Sprite;
  10.    import flash.display.Stage;
  11.    import flash.display.StageAlign;
  12.    import flash.display.StageScaleMode;
  13.    import flash.events.Event;
  14.    import flash.events.IEventDispatcher;
  15.    import flash.events.MouseEvent;
  16.    import flash.events.TimerEvent;
  17.    import flash.geom.Point;
  18.    import flash.geom.Rectangle;
  19.    import flash.system.ApplicationDomain;
  20.    import flash.text.Font;
  21.    import flash.text.TextFormat;
  22.    import flash.utils.Dictionary;
  23.    import flash.utils.Timer;
  24.    import flash.utils.getQualifiedClassName;
  25.    import mx.core.FlexSprite;
  26.    import mx.core.IChildList;
  27.    import mx.core.IFlexDisplayObject;
  28.    import mx.core.IFlexModuleFactory;
  29.    import mx.core.IInvalidating;
  30.    import mx.core.IRawChildrenContainer;
  31.    import mx.core.IUIComponent;
  32.    import mx.core.Singleton;
  33.    import mx.core.mx_internal;
  34.    import mx.events.FlexEvent;
  35.    import mx.messaging.config.LoaderConfig;
  36.    import mx.preloaders.DownloadProgressBar;
  37.    import mx.preloaders.Preloader;
  38.    import mx.styles.ISimpleStyleClient;
  39.    import mx.styles.IStyleClient;
  40.    
  41.    use namespace mx_internal;
  42.    
  43.    public class SystemManager extends MovieClip implements IChildList, IFlexDisplayObject, IFlexModuleFactory, ISystemManager
  44.    {
  45.       mx_internal static var lastSystemManager:SystemManager;
  46.       
  47.       mx_internal static const VERSION:String = "2.0.1.0";
  48.       
  49.       private static const IDLE_THRESHOLD:Number = 1000;
  50.       
  51.       private static const IDLE_INTERVAL:Number = 100;
  52.       
  53.       mx_internal static var allSystemManagers:Dictionary = new Dictionary(true);
  54.       
  55.       mx_internal var nestLevel:int = 0;
  56.       
  57.       private var forms:Array;
  58.       
  59.       private var mouseCatcher:Sprite;
  60.       
  61.       private var _height:Number;
  62.       
  63.       private var preloader:Preloader;
  64.       
  65.       private var _topLevelSystemManager:ISystemManager;
  66.       
  67.       private var _rawChildren:SystemRawChildrenList;
  68.       
  69.       private var _toolTipIndex:int = 0;
  70.       
  71.       private var _explicitHeight:Number;
  72.       
  73.       private var _document:Object;
  74.       
  75.       private var form:IFocusManagerContainer;
  76.       
  77.       private var _width:Number;
  78.       
  79.       private var _toolTipChildren:SystemChildrenList;
  80.       
  81.       private var initialized:Boolean = false;
  82.       
  83.       private var _focusPane:Sprite;
  84.       
  85.       private var isStageRoot:Boolean = true;
  86.       
  87.       private var rslSizes:Array = null;
  88.       
  89.       private var _fontList:Object = null;
  90.       
  91.       private var nextFrameTimer:Timer = null;
  92.       
  93.       private var topLevel:Boolean = true;
  94.       
  95.       private var _popUpChildren:SystemChildrenList;
  96.       
  97.       private var _cursorIndex:int = 0;
  98.       
  99.       private var _topMostIndex:int = 0;
  100.       
  101.       mx_internal var _mouseX:*;
  102.       
  103.       mx_internal var _mouseY:*;
  104.       
  105.       private var _numModalWindows:int = 0;
  106.       
  107.       private var _screen:Rectangle;
  108.       
  109.       mx_internal var idleCounter:int = 0;
  110.       
  111.       private var initCallbackFunctions:Array;
  112.       
  113.       private var _cursorChildren:SystemChildrenList;
  114.       
  115.       private var _noTopMostIndex:int = 0;
  116.       
  117.       private var _applicationIndex:int = 1;
  118.       
  119.       private var idleTimer:Timer;
  120.       
  121.       private var doneExecutingInitCallbacks:Boolean = false;
  122.       
  123.       private var _explicitWidth:Number;
  124.       
  125.       mx_internal var topLevelWindow:IUIComponent;
  126.       
  127.       public function SystemManager()
  128.       {
  129.          doneExecutingInitCallbacks = false;
  130.          initCallbackFunctions = [];
  131.          initialized = false;
  132.          topLevel = true;
  133.          isStageRoot = true;
  134.          mx_internal::nestLevel = 0;
  135.          rslSizes = null;
  136.          forms = [];
  137.          mx_internal::idleCounter = 0;
  138.          nextFrameTimer = null;
  139.          _applicationIndex = 1;
  140.          _cursorIndex = 0;
  141.          _fontList = null;
  142.          _noTopMostIndex = 0;
  143.          _numModalWindows = 0;
  144.          _toolTipIndex = 0;
  145.          _topMostIndex = 0;
  146.          super();
  147.          if(stage)
  148.          {
  149.             stage.scaleMode = StageScaleMode.NO_SCALE;
  150.             stage.align = StageAlign.TOP_LEFT;
  151.          }
  152.          if(SystemManagerGlobals.topLevelSystemManagers.length > 0 && !stage)
  153.          {
  154.             topLevel = false;
  155.          }
  156.          if(!stage)
  157.          {
  158.             isStageRoot = false;
  159.          }
  160.          if(topLevel)
  161.          {
  162.             SystemManagerGlobals.topLevelSystemManagers.push(this);
  163.          }
  164.          mx_internal::lastSystemManager = this;
  165.          executeCallbacks();
  166.          stop();
  167.          if(topLevel && currentFrame != 1)
  168.          {
  169.             throw new Error("The SystemManager constructor was called when the currentFrame was at " + currentFrame + " Please add this SWF to bug 129782.");
  170.          }
  171.          root.loaderInfo.addEventListener(Event.INIT,initHandler);
  172.       }
  173.       
  174.       public static function getSWFRoot(param1:Object) : DisplayObject
  175.       {
  176.          var className:String = null;
  177.          var p:* = undefined;
  178.          var sm:SystemManager = null;
  179.          var domain:ApplicationDomain = null;
  180.          var cls:Class = null;
  181.          var object:Object = param1;
  182.          className = getQualifiedClassName(object);
  183.          for(p in mx_internal::allSystemManagers)
  184.          {
  185.             sm = p as SystemManager;
  186.             domain = sm.loaderInfo.applicationDomain;
  187.             try
  188.             {
  189.                cls = Class(domain.getDefinition(className));
  190.                if(object is cls)
  191.                {
  192.                   return sm;
  193.                }
  194.             }
  195.             catch(e:Error)
  196.             {
  197.             }
  198.          }
  199.          return null;
  200.       }
  201.       
  202.       mx_internal static function registerInitCallback(param1:Function) : void
  203.       {
  204.          var _loc2_:SystemManager = null;
  205.          if(!mx_internal::allSystemManagers || !mx_internal::lastSystemManager)
  206.          {
  207.             return;
  208.          }
  209.          _loc2_ = mx_internal::lastSystemManager;
  210.          if(_loc2_.doneExecutingInitCallbacks)
  211.          {
  212.             param1(_loc2_);
  213.          }
  214.          else
  215.          {
  216.             _loc2_.initCallbackFunctions.push(param1);
  217.          }
  218.       }
  219.       
  220.       mx_internal function addingChild(param1:DisplayObject) : void
  221.       {
  222.          var _loc2_:int = 0;
  223.          var _loc3_:Class = null;
  224.          var _loc4_:DisplayObjectContainer = null;
  225.          _loc2_ = 1;
  226.          if(!topLevel)
  227.          {
  228.             _loc4_ = parent.parent;
  229.             while(_loc4_)
  230.             {
  231.                if(_loc4_ is ILayoutManagerClient)
  232.                {
  233.                   _loc2_ = ILayoutManagerClient(_loc4_).nestLevel + 1;
  234.                   break;
  235.                }
  236.                _loc4_ = _loc4_.parent;
  237.             }
  238.          }
  239.          mx_internal::nestLevel = _loc2_;
  240.          if(param1 is IUIComponent)
  241.          {
  242.             IUIComponent(param1).systemManager = this;
  243.          }
  244.          _loc3_ = Class(getDefinitionByName("mx.core.UIComponent"));
  245.          if(param1 is IUIComponent && !IUIComponent(param1).document)
  246.          {
  247.             IUIComponent(param1).document = document;
  248.          }
  249.          if(param1 is ILayoutManagerClient)
  250.          {
  251.             ILayoutManagerClient(param1).nestLevel = mx_internal::nestLevel + 1;
  252.          }
  253.          if(param1 is InteractiveObject)
  254.          {
  255.             if(doubleClickEnabled)
  256.             {
  257.                InteractiveObject(param1).doubleClickEnabled = true;
  258.             }
  259.          }
  260.          if(param1 is IUIComponent)
  261.          {
  262.             IUIComponent(param1).parentChanged(this);
  263.          }
  264.          if(param1 is IStyleClient)
  265.          {
  266.             IStyleClient(param1).regenerateStyleCache(true);
  267.          }
  268.          if(param1 is ISimpleStyleClient)
  269.          {
  270.             ISimpleStyleClient(param1).styleChanged(null);
  271.          }
  272.          if(param1 is IStyleClient)
  273.          {
  274.             IStyleClient(param1).notifyStyleChangeInChildren(null,true);
  275.          }
  276.          if(Boolean(_loc3_) && param1 is _loc3_)
  277.          {
  278.             _loc3_(param1).initThemeColor();
  279.          }
  280.          if(Boolean(_loc3_) && param1 is _loc3_)
  281.          {
  282.             _loc3_(param1).stylesInitialized();
  283.          }
  284.       }
  285.       
  286.       mx_internal function rawChildren_addChild(param1:DisplayObject) : DisplayObject
  287.       {
  288.          mx_internal::addingChild(param1);
  289.          super.addChild(param1);
  290.          mx_internal::childAdded(param1);
  291.          return param1;
  292.       }
  293.       
  294.       public function getExplicitOrMeasuredHeight() : Number
  295.       {
  296.          return !isNaN(explicitHeight) ? explicitHeight : measuredHeight;
  297.       }
  298.       
  299.       mx_internal function notifyStyleChangeInChildren(param1:String, param2:Boolean) : void
  300.       {
  301.          var _loc3_:Boolean = false;
  302.          var _loc4_:int = 0;
  303.          var _loc5_:int = 0;
  304.          var _loc6_:IStyleClient = null;
  305.          _loc3_ = false;
  306.          _loc4_ = rawChildren.numChildren;
  307.          _loc5_ = 0;
  308.          while(_loc5_ < _loc4_)
  309.          {
  310.             _loc6_ = rawChildren.getChildAt(_loc5_) as IStyleClient;
  311.             if(_loc6_)
  312.             {
  313.                _loc6_.styleChanged(param1);
  314.                _loc6_.notifyStyleChangeInChildren(param1,param2);
  315.             }
  316.             if(isTopLevelWindow(DisplayObject(_loc6_)))
  317.             {
  318.                _loc3_ = true;
  319.             }
  320.             _loc4_ = rawChildren.numChildren;
  321.             _loc5_++;
  322.          }
  323.          if(!_loc3_ && mx_internal::topLevelWindow is IStyleClient)
  324.          {
  325.             IStyleClient(mx_internal::topLevelWindow).styleChanged(param1);
  326.             IStyleClient(mx_internal::topLevelWindow).notifyStyleChangeInChildren(param1,param2);
  327.          }
  328.       }
  329.       
  330.       mx_internal function rawChildren_getObjectsUnderPoint(param1:Point) : Array
  331.       {
  332.          return super.getObjectsUnderPoint(param1);
  333.       }
  334.       
  335.       override public function contains(param1:DisplayObject) : Boolean
  336.       {
  337.          var _loc2_:int = 0;
  338.          var _loc3_:int = 0;
  339.          var _loc4_:DisplayObject = null;
  340.          if(super.contains(param1))
  341.          {
  342.             if(param1.parent == this)
  343.             {
  344.                _loc2_ = super.getChildIndex(param1);
  345.                if(_loc2_ < mx_internal::noTopMostIndex)
  346.                {
  347.                   return true;
  348.                }
  349.             }
  350.             else
  351.             {
  352.                _loc3_ = 0;
  353.                while(_loc3_ < mx_internal::noTopMostIndex)
  354.                {
  355.                   _loc4_ = super.getChildAt(_loc3_);
  356.                   if(_loc4_ is IRawChildrenContainer)
  357.                   {
  358.                      if(IRawChildrenContainer(_loc4_).rawChildren.contains(param1))
  359.                      {
  360.                         return true;
  361.                      }
  362.                   }
  363.                   if(_loc4_ is DisplayObjectContainer)
  364.                   {
  365.                      if(DisplayObjectContainer(_loc4_).contains(param1))
  366.                      {
  367.                         return true;
  368.                      }
  369.                   }
  370.                   _loc3_++;
  371.                }
  372.             }
  373.          }
  374.          return false;
  375.       }
  376.       
  377.       private function idleTimer_timerHandler(param1:TimerEvent) : void
  378.       {
  379.          ++mx_internal::idleCounter;
  380.          if(mx_internal::idleCounter * IDLE_INTERVAL > IDLE_THRESHOLD)
  381.          {
  382.             dispatchEvent(new FlexEvent(FlexEvent.IDLE));
  383.          }
  384.       }
  385.       
  386.       private function initHandler(param1:Event) : void
  387.       {
  388.          var _loc2_:int = 0;
  389.          var _loc3_:int = 0;
  390.          mx_internal::allSystemManagers[this] = this.loaderInfo.url;
  391.          root.loaderInfo.removeEventListener(Event.INIT,initHandler);
  392.          _loc2_ = totalFrames == 1 ? 0 : 1;
  393.          addFrameScript(_loc2_,docFrameHandler);
  394.          _loc3_ = _loc2_ + 1;
  395.          while(_loc3_ < totalFrames)
  396.          {
  397.             addFrameScript(_loc3_,extraFrameHandler);
  398.             _loc3_++;
  399.          }
  400.          mx_internal::initialize();
  401.       }
  402.       
  403.       public function getDefinitionByName(param1:String) : Object
  404.       {
  405.          var _loc2_:ApplicationDomain = null;
  406.          var _loc3_:Object = null;
  407.          _loc2_ = !topLevel && parent is Loader ? Loader(parent).contentLoaderInfo.applicationDomain : info()["currentDomain"] as ApplicationDomain;
  408.          if(_loc2_.hasDefinition(param1))
  409.          {
  410.             _loc3_ = _loc2_.getDefinition(param1);
  411.          }
  412.          return _loc3_;
  413.       }
  414.       
  415.       public function get embeddedFontList() : Object
  416.       {
  417.          var _loc1_:Object = null;
  418.          var _loc2_:String = null;
  419.          var _loc3_:Object = null;
  420.          if(_fontList == null)
  421.          {
  422.             _fontList = {};
  423.             _loc1_ = info()["fonts"];
  424.             for(_loc2_ in _loc1_)
  425.             {
  426.                _fontList[_loc2_] = _loc1_[_loc2_];
  427.             }
  428.             if(!topLevel && Boolean(_topLevelSystemManager))
  429.             {
  430.                _loc3_ = _topLevelSystemManager.embeddedFontList;
  431.                for(_loc2_ in _loc3_)
  432.                {
  433.                   _fontList[_loc2_] = _loc3_[_loc2_];
  434.                }
  435.             }
  436.          }
  437.          return _fontList;
  438.       }
  439.       
  440.       mx_internal function set cursorIndex(param1:int) : void
  441.       {
  442.          var _loc2_:int = 0;
  443.          _loc2_ = param1 - _cursorIndex;
  444.          _cursorIndex = param1;
  445.       }
  446.       
  447.       override public function getChildAt(param1:int) : DisplayObject
  448.       {
  449.          return super.getChildAt(mx_internal::applicationIndex + param1);
  450.       }
  451.       
  452.       public function set document(param1:Object) : void
  453.       {
  454.          _document = param1;
  455.       }
  456.       
  457.       override public function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
  458.       {
  459.          if(param1 == FlexEvent.IDLE && !idleTimer)
  460.          {
  461.             idleTimer = new Timer(IDLE_INTERVAL);
  462.             idleTimer.addEventListener(TimerEvent.TIMER,idleTimer_timerHandler);
  463.             idleTimer.start();
  464.             addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true);
  465.             addEventListener(MouseEvent.MOUSE_UP,mouseUpHandler,true);
  466.          }
  467.          super.addEventListener(param1,param2,param3,param4,param5);
  468.       }
  469.       
  470.       override public function get mouseX() : Number
  471.       {
  472.          if(mx_internal::_mouseX === undefined)
  473.          {
  474.             return super.mouseX;
  475.          }
  476.          return mx_internal::_mouseX;
  477.       }
  478.       
  479.       override public function get mouseY() : Number
  480.       {
  481.          if(mx_internal::_mouseY === undefined)
  482.          {
  483.             return super.mouseY;
  484.          }
  485.          return mx_internal::_mouseY;
  486.       }
  487.       
  488.       public function removeFocusManager(param1:IFocusManagerContainer) : void
  489.       {
  490.          var _loc2_:int = 0;
  491.          var _loc3_:int = 0;
  492.          _loc2_ = int(forms.length);
  493.          _loc3_ = 0;
  494.          while(_loc3_ < _loc2_)
  495.          {
  496.             if(forms[_loc3_] == param1)
  497.             {
  498.                if(form == param1)
  499.                {
  500.                   deactivate(param1);
  501.                }
  502.                forms.splice(_loc3_,1);
  503.                return;
  504.             }
  505.             _loc3_++;
  506.          }
  507.       }
  508.       
  509.       private function mouseMoveHandler(param1:MouseEvent) : void
  510.       {
  511.          mx_internal::idleCounter = 0;
  512.       }
  513.       
  514.       public function get rawChildren() : IChildList
  515.       {
  516.          if(!topLevel)
  517.          {
  518.             return _topLevelSystemManager.rawChildren;
  519.          }
  520.          if(!_rawChildren)
  521.          {
  522.             _rawChildren = new SystemRawChildrenList(this);
  523.          }
  524.          return _rawChildren;
  525.       }
  526.       
  527.       public function get focusPane() : Sprite
  528.       {
  529.          return _focusPane;
  530.       }
  531.       
  532.       private function mouseDownHandler(param1:MouseEvent) : void
  533.       {
  534.          var _loc2_:int = 0;
  535.          var _loc3_:DisplayObject = null;
  536.          var _loc4_:Boolean = false;
  537.          var _loc5_:int = 0;
  538.          var _loc6_:int = 0;
  539.          var _loc7_:int = 0;
  540.          var _loc8_:int = 0;
  541.          var _loc9_:IChildList = null;
  542.          mx_internal::idleCounter = 0;
  543.          if(numModalWindows == 0)
  544.          {
  545.             if(forms.length > 1)
  546.             {
  547.                _loc2_ = int(forms.length);
  548.                _loc3_ = DisplayObject(param1.target);
  549.                _loc4_ = Boolean(document.rawChildren.contains(_loc3_));
  550.                while(_loc3_)
  551.                {
  552.                   _loc5_ = 0;
  553.                   while(_loc5_ < _loc2_)
  554.                   {
  555.                      if(forms[_loc5_] == _loc3_)
  556.                      {
  557.                         _loc6_ = 0;
  558.                         if(_loc3_ != form && _loc3_ is IFocusManagerContainer)
  559.                         {
  560.                            activate(IFocusManagerContainer(_loc3_));
  561.                         }
  562.                         if(popUpChildren.contains(_loc3_))
  563.                         {
  564.                            _loc9_ = popUpChildren;
  565.                         }
  566.                         else
  567.                         {
  568.                            _loc9_ = this;
  569.                         }
  570.                         _loc8_ = _loc7_ = _loc9_.getChildIndex(_loc3_);
  571.                         _loc2_ = int(forms.length);
  572.                         _loc6_ = 0;
  573.                         while(_loc6_ < _loc2_)
  574.                         {
  575.                            if(_loc9_.contains(forms[_loc6_]))
  576.                            {
  577.                               if(_loc9_.getChildIndex(forms[_loc6_]) > _loc7_)
  578.                               {
  579.                                  _loc8_ = _loc9_.getChildIndex(forms[_loc6_]);
  580.                               }
  581.                            }
  582.                            _loc6_++;
  583.                         }
  584.                         if(_loc8_ > _loc7_ && !_loc4_)
  585.                         {
  586.                            _loc9_.setChildIndex(_loc3_,_loc8_);
  587.                         }
  588.                         return;
  589.                      }
  590.                      _loc5_++;
  591.                   }
  592.                   _loc3_ = _loc3_.parent;
  593.                }
  594.             }
  595.          }
  596.       }
  597.       
  598.       public function get screen() : Rectangle
  599.       {
  600.          if(!_screen)
  601.          {
  602.             Stage_resizeHandler();
  603.          }
  604.          return _screen;
  605.       }
  606.       
  607.       public function get preloaderBackgroundSize() : String
  608.       {
  609.          return info()["backgroundSize"];
  610.       }
  611.       
  612.       private function docFrameHandler(param1:Event = null) : void
  613.       {
  614.          var _loc2_:Array = null;
  615.          var _loc3_:int = 0;
  616.          var _loc4_:int = 0;
  617.          var _loc5_:Class = null;
  618.          Singleton.registerClass("mx.managers::ICursorManager",Class(getDefinitionByName("mx.managers::CursorManagerImpl")));
  619.          Singleton.registerClass("mx.managers::IDragManager",Class(getDefinitionByName("mx.managers::DragManagerImpl")));
  620.          Singleton.registerClass("mx.managers::IHistoryManager",Class(getDefinitionByName("mx.managers::HistoryManagerImpl")));
  621.          Singleton.registerClass("mx.managers::ILayoutManager",Class(getDefinitionByName("mx.managers::LayoutManager")));
  622.          Singleton.registerClass("mx.managers::IPopUpManager",Class(getDefinitionByName("mx.managers::PopUpManagerImpl")));
  623.          Singleton.registerClass("mx.styles::IStyleManager",Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
  624.          Singleton.registerClass("mx.managers::IToolTipManager",Class(getDefinitionByName("mx.managers::ToolTipManagerImpl")));
  625.          executeCallbacks();
  626.          doneExecutingInitCallbacks = true;
  627.          _loc2_ = info()["mixins"];
  628.          if(Boolean(_loc2_) && _loc2_.length > 0)
  629.          {
  630.             _loc3_ = int(_loc2_.length);
  631.             _loc4_ = 0;
  632.             while(_loc4_ < _loc3_)
  633.             {
  634.                _loc5_ = Class(getDefinitionByName(_loc2_[_loc4_]));
  635.                _loc5_["init"](this);
  636.                _loc4_++;
  637.             }
  638.          }
  639.          initializeTopLevelWindow(null);
  640.          deferredNextFrame();
  641.       }
  642.       
  643.       private function Stage_resizeHandler(param1:Event = null) : void
  644.       {
  645.          var _loc2_:Number = NaN;
  646.          var _loc3_:Number = NaN;
  647.          var _loc4_:Number = NaN;
  648.          var _loc5_:Number = NaN;
  649.          var _loc6_:Number = NaN;
  650.          var _loc7_:Number = NaN;
  651.          var _loc8_:String = null;
  652.          _loc2_ = stage.stageWidth;
  653.          _loc3_ = stage.stageHeight;
  654.          _loc4_ = loaderInfo.width;
  655.          _loc5_ = loaderInfo.height;
  656.          _loc6_ = (_loc4_ - _loc2_) / 2;
  657.          _loc7_ = (_loc5_ - _loc3_) / 2;
  658.          _loc8_ = stage.align;
  659.          if(_loc8_ == StageAlign.TOP)
  660.          {
  661.             _loc7_ = 0;
  662.          }
  663.          else if(_loc8_ == StageAlign.BOTTOM)
  664.          {
  665.             _loc7_ = _loc5_ - _loc3_;
  666.          }
  667.          else if(_loc8_ == StageAlign.LEFT)
  668.          {
  669.             _loc6_ = 0;
  670.          }
  671.          else if(_loc8_ == StageAlign.RIGHT)
  672.          {
  673.             _loc6_ = _loc4_ - _loc2_;
  674.          }
  675.          else if(_loc8_ == StageAlign.TOP_LEFT || _loc8_ == "LT")
  676.          {
  677.             _loc7_ = 0;
  678.             _loc6_ = 0;
  679.          }
  680.          else if(_loc8_ == StageAlign.TOP_RIGHT)
  681.          {
  682.             _loc7_ = 0;
  683.             _loc6_ = _loc4_ - _loc2_;
  684.          }
  685.          else if(_loc8_ == StageAlign.BOTTOM_LEFT)
  686.          {
  687.             _loc7_ = _loc5_ - _loc3_;
  688.             _loc6_ = 0;
  689.          }
  690.          else if(_loc8_ == StageAlign.BOTTOM_RIGHT)
  691.          {
  692.             _loc7_ = _loc5_ - _loc3_;
  693.             _loc6_ = _loc4_ - _loc2_;
  694.          }
  695.          if(!_screen)
  696.          {
  697.             _screen = new Rectangle();
  698.          }
  699.          _screen.x = _loc6_;
  700.          _screen.y = _loc7_;
  701.          _screen.width = _loc2_;
  702.          _screen.height = _loc3_;
  703.          if(isStageRoot)
  704.          {
  705.             _width = stage.stageWidth;
  706.             _height = stage.stageHeight;
  707.          }
  708.          if(param1)
  709.          {
  710.             resizeMouseCatcher();
  711.             dispatchEvent(param1);
  712.          }
  713.       }
  714.       
  715.       public function get explicitHeight() : Number
  716.       {
  717.          return _explicitHeight;
  718.       }
  719.       
  720.       mx_internal function set topMostIndex(param1:int) : void
  721.       {
  722.          var _loc2_:int = 0;
  723.          _loc2_ = param1 - _topMostIndex;
  724.          _topMostIndex = param1;
  725.          mx_internal::toolTipIndex += _loc2_;
  726.       }
  727.       
  728.       override public function getChildByName(param1:String) : DisplayObject
  729.       {
  730.          return super.getChildByName(param1);
  731.       }
  732.       
  733.       override public function addChildAt(param1:DisplayObject, param2:int) : DisplayObject
  734.       {
  735.          ++mx_internal::noTopMostIndex;
  736.          return mx_internal::rawChildren_addChildAt(param1,mx_internal::applicationIndex + param2);
  737.       }
  738.       
  739.       public function isTopLevel() : Boolean
  740.       {
  741.          return topLevel;
  742.       }
  743.       
  744.       public function deactivate(param1:IFocusManagerContainer) : void
  745.       {
  746.          var _loc2_:IFocusManagerContainer = null;
  747.          var _loc3_:int = 0;
  748.          var _loc4_:int = 0;
  749.          var _loc5_:IFocusManagerContainer = null;
  750.          if(form)
  751.          {
  752.             if(form == param1 && forms.length > 1)
  753.             {
  754.                form.focusManager.deactivate();
  755.                _loc3_ = int(forms.length);
  756.                _loc4_ = 0;
  757.                while(_loc4_ < _loc3_)
  758.                {
  759.                   _loc5_ = forms[_loc4_];
  760.                   if(_loc5_ == param1)
  761.                   {
  762.                      _loc4_ += 1;
  763.                      while(_loc4_ < _loc3_)
  764.                      {
  765.                         _loc5_ = forms[_loc4_];
  766.                         if(Sprite(_loc5_).visible == true && IUIComponent(_loc5_).enabled)
  767.                         {
  768.                            _loc2_ = _loc5_;
  769.                         }
  770.                         _loc4_++;
  771.                      }
  772.                      form = _loc2_;
  773.                      break;
  774.                   }
  775.                   if(Sprite(_loc5_).visible && IUIComponent(_loc5_).enabled)
  776.                   {
  777.                      _loc2_ = _loc5_;
  778.                   }
  779.                   _loc4_++;
  780.                }
  781.                if(form)
  782.                {
  783.                   form.focusManager.activate();
  784.                }
  785.             }
  786.          }
  787.       }
  788.       
  789.       public function getExplicitOrMeasuredWidth() : Number
  790.       {
  791.          return !isNaN(explicitWidth) ? explicitWidth : measuredWidth;
  792.       }
  793.       
  794.       public function info() : Object
  795.       {
  796.          return {};
  797.       }
  798.       
  799.       public function get measuredWidth() : Number
  800.       {
  801.          return !!mx_internal::topLevelWindow ? mx_internal::topLevelWindow.getExplicitOrMeasuredWidth() : loaderInfo.width;
  802.       }
  803.       
  804.       mx_internal function get toolTipIndex() : int
  805.       {
  806.          return _toolTipIndex;
  807.       }
  808.       
  809.       public function setActualSize(param1:Number, param2:Number) : void
  810.       {
  811.          if(isStageRoot)
  812.          {
  813.             return;
  814.          }
  815.          _width = param1;
  816.          _height = param2;
  817.          if(mouseCatcher)
  818.          {
  819.             mouseCatcher.width = param1;
  820.             mouseCatcher.height = param2;
  821.          }
  822.          dispatchEvent(new Event(Event.RESIZE));
  823.       }
  824.       
  825.       mx_internal function set applicationIndex(param1:int) : void
  826.       {
  827.          _applicationIndex = param1;
  828.       }
  829.       
  830.       public function set focusPane(param1:Sprite) : void
  831.       {
  832.          if(param1)
  833.          {
  834.             addChild(param1);
  835.             param1.x = 0;
  836.             param1.y = 0;
  837.             param1.scrollRect = null;
  838.             _focusPane = param1;
  839.          }
  840.          else
  841.          {
  842.             removeChild(_focusPane);
  843.             _focusPane = null;
  844.          }
  845.       }
  846.       
  847.       private function executeCallbacks() : void
  848.       {
  849.          var _loc1_:Function = null;
  850.          if(!parent)
  851.          {
  852.             return;
  853.          }
  854.          while(initCallbackFunctions.length > 0)
  855.          {
  856.             _loc1_ = initCallbackFunctions.shift();
  857.             _loc1_(this);
  858.          }
  859.       }
  860.       
  861.       override public function addChild(param1:DisplayObject) : DisplayObject
  862.       {
  863.          ++mx_internal::noTopMostIndex;
  864.          return mx_internal::rawChildren_addChildAt(param1,mx_internal::noTopMostIndex - 1);
  865.       }
  866.       
  867.       public function set explicitHeight(param1:Number) : void
  868.       {
  869.          _explicitHeight = param1;
  870.       }
  871.       
  872.       override public function removeChild(param1:DisplayObject) : DisplayObject
  873.       {
  874.          --mx_internal::noTopMostIndex;
  875.          return mx_internal::rawChildren_removeChild(param1);
  876.       }
  877.       
  878.       mx_internal function rawChildren_removeChild(param1:DisplayObject) : DisplayObject
  879.       {
  880.          mx_internal::removingChild(param1);
  881.          super.removeChild(param1);
  882.          mx_internal::childRemoved(param1);
  883.          return param1;
  884.       }
  885.       
  886.       final mx_internal function get $numChildren() : int
  887.       {
  888.          return super.numChildren;
  889.       }
  890.       
  891.       override public function get stage() : Stage
  892.       {
  893.          var _loc1_:Stage = null;
  894.          _loc1_ = super.stage;
  895.          if(_loc1_)
  896.          {
  897.             return _loc1_;
  898.          }
  899.          if(!topLevel && Boolean(_topLevelSystemManager))
  900.          {
  901.             return _topLevelSystemManager.stage;
  902.          }
  903.          return null;
  904.       }
  905.       
  906.       public function create(... rest) : Object
  907.       {
  908.          var _loc2_:String = null;
  909.          var _loc3_:Class = null;
  910.          var _loc4_:String = null;
  911.          var _loc5_:int = 0;
  912.          var _loc6_:int = 0;
  913.          _loc2_ = info()["mainClassName"];
  914.          if(_loc2_ == null)
  915.          {
  916.             _loc4_ = loaderInfo.loaderURL;
  917.             _loc5_ = int(_loc4_.lastIndexOf("."));
  918.             _loc6_ = int(_loc4_.lastIndexOf("/"));
  919.             _loc2_ = _loc4_.substring(_loc6_ + 1,_loc5_);
  920.          }
  921.          _loc3_ = Class(getDefinitionByName(_loc2_));
  922.          return !!_loc3_ ? new _loc3_() : null;
  923.       }
  924.       
  925.       override public function getChildIndex(param1:DisplayObject) : int
  926.       {
  927.          return super.getChildIndex(param1) - mx_internal::applicationIndex;
  928.       }
  929.       
  930.       public function get popUpChildren() : IChildList
  931.       {
  932.          if(!topLevel)
  933.          {
  934.             return _topLevelSystemManager.popUpChildren;
  935.          }
  936.          if(!_popUpChildren)
  937.          {
  938.             _popUpChildren = new SystemChildrenList(this,new QName(mx_internal,"noTopMostIndex"),new QName(mx_internal,"topMostIndex"));
  939.          }
  940.          return _popUpChildren;
  941.       }
  942.       
  943.       public function activate(param1:IFocusManagerContainer) : void
  944.       {
  945.          var _loc2_:IFocusManagerContainer = null;
  946.          if(form)
  947.          {
  948.             if(form != param1 && forms.length > 1)
  949.             {
  950.                _loc2_ = form;
  951.                _loc2_.focusManager.deactivate();
  952.             }
  953.          }
  954.          form = param1;
  955.          if(param1.focusManager)
  956.          {
  957.             param1.focusManager.activate();
  958.          }
  959.       }
  960.       
  961.       override public function setChildIndex(param1:DisplayObject, param2:int) : void
  962.       {
  963.          super.setChildIndex(param1,mx_internal::applicationIndex + param2);
  964.       }
  965.       
  966.       public function get toolTipChildren() : IChildList
  967.       {
  968.          if(!topLevel)
  969.          {
  970.             return _topLevelSystemManager.toolTipChildren;
  971.          }
  972.          if(!_toolTipChildren)
  973.          {
  974.             _toolTipChildren = new SystemChildrenList(this,new QName(mx_internal,"topMostIndex"),new QName(mx_internal,"toolTipIndex"));
  975.          }
  976.          return _toolTipChildren;
  977.       }
  978.       
  979.       private function deferredNextFrame() : void
  980.       {
  981.          if(currentFrame + 1 > totalFrames)
  982.          {
  983.             return;
  984.          }
  985.          if(currentFrame + 1 <= framesLoaded)
  986.          {
  987.             nextFrame();
  988.          }
  989.          else
  990.          {
  991.             nextFrameTimer = new Timer(100);
  992.             nextFrameTimer.addEventListener(TimerEvent.TIMER,nextFrameTimerHandler);
  993.             nextFrameTimer.start();
  994.          }
  995.       }
  996.       
  997.       mx_internal function get cursorIndex() : int
  998.       {
  999.          return _cursorIndex;
  1000.       }
  1001.       
  1002.       override public function getObjectsUnderPoint(param1:Point) : Array
  1003.       {
  1004.          var _loc2_:Array = null;
  1005.          var _loc3_:int = 0;
  1006.          var _loc4_:int = 0;
  1007.          var _loc5_:DisplayObject = null;
  1008.          var _loc6_:Array = null;
  1009.          _loc2_ = [];
  1010.          _loc3_ = mx_internal::topMostIndex;
  1011.          _loc4_ = 0;
  1012.          while(_loc4_ < _loc3_)
  1013.          {
  1014.             _loc5_ = super.getChildAt(_loc4_);
  1015.             if(_loc5_ is DisplayObjectContainer)
  1016.             {
  1017.                _loc6_ = DisplayObjectContainer(_loc5_).getObjectsUnderPoint(param1);
  1018.                if(_loc6_)
  1019.                {
  1020.                   _loc2_ = _loc2_.concat(_loc6_);
  1021.                }
  1022.             }
  1023.             _loc4_++;
  1024.          }
  1025.          return _loc2_;
  1026.       }
  1027.       
  1028.       mx_internal function rawChildren_contains(param1:DisplayObject) : Boolean
  1029.       {
  1030.          return super.contains(param1);
  1031.       }
  1032.       
  1033.       public function get document() : Object
  1034.       {
  1035.          return _document;
  1036.       }
  1037.       
  1038.       private function resizeMouseCatcher() : void
  1039.       {
  1040.          var _loc1_:Graphics = null;
  1041.          if(mouseCatcher)
  1042.          {
  1043.             _loc1_ = mouseCatcher.graphics;
  1044.             _loc1_.clear();
  1045.             _loc1_.beginFill(0,0);
  1046.             _loc1_.drawRect(0,0,stage.stageWidth,stage.stageHeight);
  1047.             _loc1_.endFill();
  1048.          }
  1049.       }
  1050.       
  1051.       override public function get height() : Number
  1052.       {
  1053.          return _height;
  1054.       }
  1055.       
  1056.       mx_internal function rawChildren_getChildIndex(param1:DisplayObject) : int
  1057.       {
  1058.          return super.getChildIndex(param1);
  1059.       }
  1060.       
  1061.       mx_internal function get topMostIndex() : int
  1062.       {
  1063.          return _topMostIndex;
  1064.       }
  1065.       
  1066.       public function addFocusManager(param1:IFocusManagerContainer) : void
  1067.       {
  1068.          forms.push(param1);
  1069.       }
  1070.       
  1071.       mx_internal function set noTopMostIndex(param1:int) : void
  1072.       {
  1073.          var _loc2_:int = 0;
  1074.          _loc2_ = param1 - _noTopMostIndex;
  1075.          _noTopMostIndex = param1;
  1076.          mx_internal::topMostIndex += _loc2_;
  1077.       }
  1078.       
  1079.       mx_internal function rawChildren_setChildIndex(param1:DisplayObject, param2:int) : void
  1080.       {
  1081.          super.setChildIndex(param1,param2);
  1082.       }
  1083.       
  1084.       private function mouseUpHandler(param1:MouseEvent) : void
  1085.       {
  1086.          mx_internal::idleCounter = 0;
  1087.       }
  1088.       
  1089.       mx_internal function childAdded(param1:DisplayObject) : void
  1090.       {
  1091.          param1.dispatchEvent(new FlexEvent(FlexEvent.ADD));
  1092.          if(param1 is IUIComponent)
  1093.          {
  1094.             IUIComponent(param1).initialize();
  1095.          }
  1096.       }
  1097.       
  1098.       public function isFontFaceEmbedded(param1:TextFormat) : Boolean
  1099.       {
  1100.          var _loc2_:String = null;
  1101.          var _loc3_:Array = null;
  1102.          var _loc4_:int = 0;
  1103.          var _loc5_:Object = null;
  1104.          var _loc6_:Font = null;
  1105.          var _loc7_:String = null;
  1106.          _loc2_ = param1.font;
  1107.          _loc3_ = Font.enumerateFonts();
  1108.          _loc4_ = 0;
  1109.          while(_loc4_ < _loc3_.length)
  1110.          {
  1111.             _loc6_ = Font(_loc3_[_loc4_]);
  1112.             if(_loc6_.fontName == _loc2_)
  1113.             {
  1114.                _loc7_ = "regular";
  1115.                if(Boolean(param1.bold) && Boolean(param1.italic))
  1116.                {
  1117.                   _loc7_ = "boldItalic";
  1118.                }
  1119.                else if(param1.bold)
  1120.                {
  1121.                   _loc7_ = "bold";
  1122.                }
  1123.                else if(param1.italic)
  1124.                {
  1125.                   _loc7_ = "italic";
  1126.                }
  1127.                if(_loc6_.fontStyle == _loc7_)
  1128.                {
  1129.                   return true;
  1130.                }
  1131.             }
  1132.             _loc4_++;
  1133.          }
  1134.          if(!_loc2_ || !embeddedFontList || !embeddedFontList[_loc2_])
  1135.          {
  1136.             return false;
  1137.          }
  1138.          _loc5_ = embeddedFontList[_loc2_];
  1139.          return !(Boolean(param1.bold) && !_loc5_.bold || Boolean(param1.italic) && !_loc5_.italic || !param1.bold && !param1.italic && !_loc5_.regular);
  1140.       }
  1141.       
  1142.       mx_internal function rawChildren_getChildAt(param1:int) : DisplayObject
  1143.       {
  1144.          return super.getChildAt(param1);
  1145.       }
  1146.       
  1147.       override public function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
  1148.       {
  1149.          if(param1 == FlexEvent.IDLE)
  1150.          {
  1151.             super.removeEventListener(param1,param2,param3);
  1152.             if(!hasEventListener(FlexEvent.IDLE) && Boolean(idleTimer))
  1153.             {
  1154.                idleTimer.stop();
  1155.                idleTimer = null;
  1156.                removeEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
  1157.                removeEventListener(MouseEvent.MOUSE_UP,mouseUpHandler);
  1158.             }
  1159.          }
  1160.          else
  1161.          {
  1162.             super.removeEventListener(param1,param2,param3);
  1163.          }
  1164.       }
  1165.       
  1166.       override public function removeChildAt(param1:int) : DisplayObject
  1167.       {
  1168.          --mx_internal::noTopMostIndex;
  1169.          return mx_internal::rawChildren_removeChildAt(mx_internal::applicationIndex + param1);
  1170.       }
  1171.       
  1172.       private function extraFrameHandler(param1:Event = null) : void
  1173.       {
  1174.          var _loc2_:Object = null;
  1175.          var _loc3_:Class = null;
  1176.          _loc2_ = info()["frames"];
  1177.          if(Boolean(_loc2_) && Boolean(_loc2_[currentLabel]))
  1178.          {
  1179.             _loc3_ = Class(getDefinitionByName(_loc2_[currentLabel]));
  1180.             _loc3_["frame"](this);
  1181.          }
  1182.          deferredNextFrame();
  1183.       }
  1184.       
  1185.       public function get application() : IUIComponent
  1186.       {
  1187.          return IUIComponent(_document);
  1188.       }
  1189.       
  1190.       mx_internal function rawChildren_removeChildAt(param1:int) : DisplayObject
  1191.       {
  1192.          var _loc2_:DisplayObject = null;
  1193.          _loc2_ = super.getChildAt(param1);
  1194.          mx_internal::removingChild(_loc2_);
  1195.          super.removeChildAt(param1);
  1196.          mx_internal::childRemoved(_loc2_);
  1197.          return _loc2_;
  1198.       }
  1199.       
  1200.       mx_internal function removingChild(param1:DisplayObject) : void
  1201.       {
  1202.          param1.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
  1203.       }
  1204.       
  1205.       mx_internal function get applicationIndex() : int
  1206.       {
  1207.          return _applicationIndex;
  1208.       }
  1209.       
  1210.       mx_internal function set toolTipIndex(param1:int) : void
  1211.       {
  1212.          var _loc2_:int = 0;
  1213.          _loc2_ = param1 - _toolTipIndex;
  1214.          _toolTipIndex = param1;
  1215.          mx_internal::cursorIndex += _loc2_;
  1216.       }
  1217.       
  1218.       public function get cursorChildren() : IChildList
  1219.       {
  1220.          if(!topLevel)
  1221.          {
  1222.             return _topLevelSystemManager.cursorChildren;
  1223.          }
  1224.          if(!_cursorChildren)
  1225.          {
  1226.             _cursorChildren = new SystemChildrenList(this,new QName(mx_internal,"toolTipIndex"),new QName(mx_internal,"cursorIndex"));
  1227.          }
  1228.          return _cursorChildren;
  1229.       }
  1230.       
  1231.       public function get preloaderBackgroundImage() : Object
  1232.       {
  1233.          return info()["backgroundImage"];
  1234.       }
  1235.       
  1236.       public function set numModalWindows(param1:int) : void
  1237.       {
  1238.          _numModalWindows = param1;
  1239.       }
  1240.       
  1241.       public function get preloaderBackgroundAlpha() : Number
  1242.       {
  1243.          return info()["backgroundAlpha"];
  1244.       }
  1245.       
  1246.       private function preloader_preloaderDoneHandler(param1:Event) : void
  1247.       {
  1248.          var _loc2_:IUIComponent = null;
  1249.          _loc2_ = mx_internal::topLevelWindow;
  1250.          preloader.removeEventListener(FlexEvent.PRELOADER_DONE,preloader_preloaderDoneHandler);
  1251.          _popUpChildren.removeChild(preloader);
  1252.          mouseCatcher = new FlexSprite();
  1253.          mouseCatcher.name = "mouseCatcher";
  1254.          ++mx_internal::noTopMostIndex;
  1255.          super.addChildAt(mouseCatcher,0);
  1256.          resizeMouseCatcher();
  1257.          if(!topLevel)
  1258.          {
  1259.             mouseCatcher.visible = false;
  1260.             mask = mouseCatcher;
  1261.          }
  1262.          ++mx_internal::noTopMostIndex;
  1263.          super.addChildAt(DisplayObject(_loc2_),1);
  1264.          _loc2_.dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
  1265.          dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
  1266.       }
  1267.       
  1268.       mx_internal function rawChildren_getChildByName(param1:String) : DisplayObject
  1269.       {
  1270.          return super.getChildByName(param1);
  1271.       }
  1272.       
  1273.       mx_internal function initialize() : void
  1274.       {
  1275.          var _loc1_:Array = null;
  1276.          var _loc2_:Array = null;
  1277.          var _loc3_:Array = null;
  1278.          var _loc4_:int = 0;
  1279.          var _loc5_:Boolean = false;
  1280.          var _loc6_:Class = null;
  1281.          if(isStageRoot)
  1282.          {
  1283.             _width = stage.stageWidth;
  1284.             _height = stage.stageHeight;
  1285.          }
  1286.          else
  1287.          {
  1288.             _width = loaderInfo.width;
  1289.             _height = loaderInfo.height;
  1290.          }
  1291.          preloader = new Preloader();
  1292.          preloader.addEventListener(FlexEvent.INIT_PROGRESS,preloader_initProgressHandler);
  1293.          preloader.addEventListener(FlexEvent.PRELOADER_DONE,preloader_preloaderDoneHandler);
  1294.          if(!_popUpChildren)
  1295.          {
  1296.             _popUpChildren = new SystemChildrenList(this,new QName(mx_internal,"noTopMostIndex"),new QName(mx_internal,"topMostIndex"));
  1297.          }
  1298.          _popUpChildren.addChild(preloader);
  1299.          _loc1_ = [];
  1300.          _loc2_ = [];
  1301.          _loc3_ = info()["rsls"];
  1302.          _loc4_ = 0;
  1303.          while(Boolean(_loc3_) && _loc4_ < _loc3_.length)
  1304.          {
  1305.             _loc1_[_loc4_] = _loc3_[_loc4_].url;
  1306.             _loc2_[_loc4_] = _loc3_[_loc4_].size;
  1307.             _loc4_++;
  1308.          }
  1309.          _loc5_ = true;
  1310.          if(info()["usePreloader"] != undefined)
  1311.          {
  1312.             _loc5_ = Boolean(info()["usePreloader"]);
  1313.          }
  1314.          _loc6_ = info()["preloader"] as Class;
  1315.          if(_loc5_ && !_loc6_)
  1316.          {
  1317.             _loc6_ = DownloadProgressBar;
  1318.          }
  1319.          preloader.initialize(_loc5_,_loc6_,preloaderBackgroundColor,preloaderBackgroundAlpha,preloaderBackgroundImage,preloaderBackgroundSize,isStageRoot ? stage.stageWidth : loaderInfo.width,isStageRoot ? stage.stageHeight : loaderInfo.height,_loc1_,_loc2_);
  1320.       }
  1321.       
  1322.       private function appCreationCompleteHandler(param1:FlexEvent) : void
  1323.       {
  1324.          var _loc2_:DisplayObjectContainer = null;
  1325.          if(!topLevel && Boolean(parent))
  1326.          {
  1327.             _loc2_ = parent.parent;
  1328.             while(_loc2_)
  1329.             {
  1330.                if(_loc2_ is IInvalidating)
  1331.                {
  1332.                   IInvalidating(_loc2_).invalidateSize();
  1333.                   IInvalidating(_loc2_).invalidateDisplayList();
  1334.                   return;
  1335.                }
  1336.                _loc2_ = _loc2_.parent;
  1337.             }
  1338.          }
  1339.       }
  1340.       
  1341.       public function get measuredHeight() : Number
  1342.       {
  1343.          return !!mx_internal::topLevelWindow ? mx_internal::topLevelWindow.getExplicitOrMeasuredHeight() : loaderInfo.height;
  1344.       }
  1345.       
  1346.       mx_internal function regenerateStyleCache(param1:Boolean) : void
  1347.       {
  1348.          var _loc2_:Boolean = false;
  1349.          var _loc3_:int = 0;
  1350.          var _loc4_:int = 0;
  1351.          var _loc5_:IStyleClient = null;
  1352.          _loc2_ = false;
  1353.          _loc3_ = rawChildren.numChildren;
  1354.          _loc4_ = 0;
  1355.          while(_loc4_ < _loc3_)
  1356.          {
  1357.             _loc5_ = rawChildren.getChildAt(_loc4_) as IStyleClient;
  1358.             if(_loc5_)
  1359.             {
  1360.                _loc5_.regenerateStyleCache(param1);
  1361.             }
  1362.             if(isTopLevelWindow(DisplayObject(_loc5_)))
  1363.             {
  1364.                _loc2_ = true;
  1365.             }
  1366.             _loc3_ = rawChildren.numChildren;
  1367.             _loc4_++;
  1368.          }
  1369.          if(!_loc2_ && mx_internal::topLevelWindow is IStyleClient)
  1370.          {
  1371.             IStyleClient(mx_internal::topLevelWindow).regenerateStyleCache(param1);
  1372.          }
  1373.       }
  1374.       
  1375.       public function get topLevelSystemManager() : ISystemManager
  1376.       {
  1377.          if(topLevel)
  1378.          {
  1379.             return this;
  1380.          }
  1381.          return _topLevelSystemManager;
  1382.       }
  1383.       
  1384.       private function nextFrameTimerHandler(param1:TimerEvent) : void
  1385.       {
  1386.          if(currentFrame + 1 <= framesLoaded)
  1387.          {
  1388.             nextFrame();
  1389.             nextFrameTimer.removeEventListener(TimerEvent.TIMER,nextFrameTimerHandler);
  1390.             nextFrameTimer.reset();
  1391.          }
  1392.       }
  1393.       
  1394.       public function get preloaderBackgroundColor() : uint
  1395.       {
  1396.          var _loc1_:* = undefined;
  1397.          _loc1_ = info()["backgroundColor"];
  1398.          if(_loc1_ == undefined)
  1399.          {
  1400.             return 4294967295;
  1401.          }
  1402.          return uint(_loc1_);
  1403.       }
  1404.       
  1405.       mx_internal function childRemoved(param1:DisplayObject) : void
  1406.       {
  1407.          if(param1 is IUIComponent)
  1408.          {
  1409.             IUIComponent(param1).parentChanged(null);
  1410.          }
  1411.       }
  1412.       
  1413.       override public function get numChildren() : int
  1414.       {
  1415.          return mx_internal::noTopMostIndex - mx_internal::applicationIndex;
  1416.       }
  1417.       
  1418.       mx_internal function get noTopMostIndex() : int
  1419.       {
  1420.          return _noTopMostIndex;
  1421.       }
  1422.       
  1423.       mx_internal function rawChildren_addChildAt(param1:DisplayObject, param2:int) : DisplayObject
  1424.       {
  1425.          mx_internal::addingChild(param1);
  1426.          super.addChildAt(param1,param2);
  1427.          mx_internal::childAdded(param1);
  1428.          return param1;
  1429.       }
  1430.       
  1431.       public function get numModalWindows() : int
  1432.       {
  1433.          return _numModalWindows;
  1434.       }
  1435.       
  1436.       private function initializeTopLevelWindow(param1:Event) : void
  1437.       {
  1438.          var _loc2_:IUIComponent = null;
  1439.          var _loc3_:DisplayObjectContainer = null;
  1440.          initialized = true;
  1441.          if(!parent)
  1442.          {
  1443.             return;
  1444.          }
  1445.          if(!topLevel)
  1446.          {
  1447.             _loc3_ = parent.parent;
  1448.             if(!_loc3_)
  1449.             {
  1450.                return;
  1451.             }
  1452.             while(_loc3_)
  1453.             {
  1454.                if(_loc3_ is IUIComponent)
  1455.                {
  1456.                   _topLevelSystemManager = IUIComponent(_loc3_).systemManager;
  1457.                   break;
  1458.                }
  1459.                _loc3_ = _loc3_.parent;
  1460.             }
  1461.          }
  1462.          addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler,true);
  1463.          if(topLevel && Boolean(stage))
  1464.          {
  1465.             stage.addEventListener(Event.RESIZE,Stage_resizeHandler,false,0,true);
  1466.          }
  1467.          document = _loc2_ = mx_internal::topLevelWindow = IUIComponent(create());
  1468.          if(document)
  1469.          {
  1470.             IEventDispatcher(_loc2_).addEventListener(FlexEvent.CREATION_COMPLETE,appCreationCompleteHandler);
  1471.             if(topLevel && Boolean(stage))
  1472.             {
  1473.                LoaderConfig.mx_internal::_url = loaderInfo.url;
  1474.                LoaderConfig.mx_internal::_parameters = loaderInfo.parameters;
  1475.                _width = stage.stageWidth;
  1476.                _height = stage.stageHeight;
  1477.                IFlexDisplayObject(_loc2_).setActualSize(stage.stageWidth,stage.stageHeight);
  1478.             }
  1479.             else
  1480.             {
  1481.                IFlexDisplayObject(_loc2_).setActualSize(loaderInfo.width,loaderInfo.height);
  1482.             }
  1483.             preloader.registerApplication(_loc2_);
  1484.             mx_internal::addingChild(DisplayObject(_loc2_));
  1485.             mx_internal::childAdded(DisplayObject(_loc2_));
  1486.          }
  1487.          else
  1488.          {
  1489.             document = this;
  1490.          }
  1491.       }
  1492.       
  1493.       override public function get width() : Number
  1494.       {
  1495.          return _width;
  1496.       }
  1497.       
  1498.       public function isTopLevelWindow(param1:DisplayObject) : Boolean
  1499.       {
  1500.          return param1 is IUIComponent && IUIComponent(param1) == mx_internal::topLevelWindow;
  1501.       }
  1502.       
  1503.       public function move(param1:Number, param2:Number) : void
  1504.       {
  1505.       }
  1506.       
  1507.       public function set explicitWidth(param1:Number) : void
  1508.       {
  1509.          _explicitWidth = param1;
  1510.       }
  1511.       
  1512.       private function preloader_initProgressHandler(param1:Event) : void
  1513.       {
  1514.          preloader.removeEventListener(FlexEvent.INIT_PROGRESS,preloader_initProgressHandler);
  1515.          deferredNextFrame();
  1516.       }
  1517.       
  1518.       public function get explicitWidth() : Number
  1519.       {
  1520.          return _explicitWidth;
  1521.       }
  1522.    }
  1523. }
  1524.  
  1525.