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