home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 April / ME_04_2012.iso / Video-Tutorial / iPhoto / media / player.swf / scripts / mx / managers / SystemManager.as < prev    next >
Encoding:
Text File  |  2011-11-11  |  64.7 KB  |  1,986 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.Loader;
  7.    import flash.display.LoaderInfo;
  8.    import flash.display.MovieClip;
  9.    import flash.display.Sprite;
  10.    import flash.display.Stage;
  11.    import flash.display.StageAlign;
  12.    import flash.display.StageQuality;
  13.    import flash.display.StageScaleMode;
  14.    import flash.events.Event;
  15.    import flash.events.FocusEvent;
  16.    import flash.events.KeyboardEvent;
  17.    import flash.events.MouseEvent;
  18.    import flash.events.TimerEvent;
  19.    import flash.geom.Point;
  20.    import flash.geom.Rectangle;
  21.    import flash.system.ApplicationDomain;
  22.    import flash.text.Font;
  23.    import flash.text.TextFormat;
  24.    import flash.ui.Keyboard;
  25.    import flash.utils.Dictionary;
  26.    import flash.utils.Timer;
  27.    import flash.utils.getQualifiedClassName;
  28.    import mx.core.FlexSprite;
  29.    import mx.core.IChildList;
  30.    import mx.core.IFlexDisplayObject;
  31.    import mx.core.IFlexModuleFactory;
  32.    import mx.core.IInvalidating;
  33.    import mx.core.IRawChildrenContainer;
  34.    import mx.core.IUIComponent;
  35.    import mx.core.RSLData;
  36.    import mx.core.RSLItem;
  37.    import mx.core.Singleton;
  38.    import mx.core.mx_internal;
  39.    import mx.events.DynamicEvent;
  40.    import mx.events.FlexEvent;
  41.    import mx.events.RSLEvent;
  42.    import mx.events.Request;
  43.    import mx.events.SandboxMouseEvent;
  44.    import mx.preloaders.Preloader;
  45.    import mx.utils.DensityUtil;
  46.    import mx.utils.LoaderUtil;
  47.    
  48.    use namespace mx_internal;
  49.    
  50.    public class SystemManager extends MovieClip implements IChildList, IFlexDisplayObject, IFlexModuleFactory, ISystemManager
  51.    {
  52.       mx_internal static const VERSION:String = "4.5.0.20967";
  53.       
  54.       private static const IDLE_THRESHOLD:Number = 1000;
  55.       
  56.       private static const IDLE_INTERVAL:Number = 100;
  57.       
  58.       mx_internal static var allSystemManagers:Dictionary = new Dictionary(true);
  59.       
  60.       mx_internal var topLevel:Boolean = true;
  61.       
  62.       private var isDispatchingResizeEvent:Boolean;
  63.       
  64.       mx_internal var isStageRoot:Boolean = true;
  65.       
  66.       mx_internal var isBootstrapRoot:Boolean = false;
  67.       
  68.       private var _topLevelSystemManager:ISystemManager;
  69.       
  70.       mx_internal var childManager:ISystemManagerChildManager;
  71.       
  72.       private var _stage:Stage;
  73.       
  74.       mx_internal var nestLevel:int = 0;
  75.       
  76.       mx_internal var preloader:Preloader;
  77.       
  78.       private var mouseCatcher:Sprite;
  79.       
  80.       mx_internal var topLevelWindow:IUIComponent;
  81.       
  82.       mx_internal var idleCounter:int = 0;
  83.       
  84.       private var idleTimer:Timer;
  85.       
  86.       private var nextFrameTimer:Timer = null;
  87.       
  88.       private var lastFrame:int;
  89.       
  90.       private var readyForKickOff:Boolean;
  91.       
  92.       public var _resourceBundles:Array;
  93.       
  94.       private var rslDataList:Array;
  95.       
  96.       private var _height:Number;
  97.       
  98.       private var _width:Number;
  99.       
  100.       private var _allowDomainsInNewRSLs:Boolean = true;
  101.       
  102.       private var _allowInsecureDomainsInNewRSLs:Boolean = true;
  103.       
  104.       private var _applicationIndex:int = 1;
  105.       
  106.       private var _cursorChildren:SystemChildrenList;
  107.       
  108.       private var _cursorIndex:int = 0;
  109.       
  110.       private var _densityScale:Number = NaN;
  111.       
  112.       private var _document:Object;
  113.       
  114.       private var _fontList:Object = null;
  115.       
  116.       private var _explicitHeight:Number;
  117.       
  118.       private var _explicitWidth:Number;
  119.       
  120.       private var _focusPane:Sprite;
  121.       
  122.       private var _noTopMostIndex:int = 0;
  123.       
  124.       private var _numModalWindows:int = 0;
  125.       
  126.       private var _popUpChildren:SystemChildrenList;
  127.       
  128.       private var _rawChildren:SystemRawChildrenList;
  129.       
  130.       mx_internal var _screen:Rectangle;
  131.       
  132.       private var _toolTipChildren:SystemChildrenList;
  133.       
  134.       private var _toolTipIndex:int = 0;
  135.       
  136.       private var _topMostIndex:int = 0;
  137.       
  138.       mx_internal var _mouseX:*;
  139.       
  140.       mx_internal var _mouseY:*;
  141.       
  142.       private var implMap:Object = {};
  143.       
  144.       public function SystemManager()
  145.       {
  146.          super();
  147.          if(this.stage)
  148.          {
  149.             this.stage.scaleMode = StageScaleMode.NO_SCALE;
  150.             this.stage.align = StageAlign.TOP_LEFT;
  151.             this.stage.quality = StageQuality.HIGH;
  152.          }
  153.          if(SystemManagerGlobals.topLevelSystemManagers.length > 0 && !this.stage)
  154.          {
  155.             this.mx_internal::topLevel = false;
  156.          }
  157.          if(!this.stage)
  158.          {
  159.             this.mx_internal::isStageRoot = false;
  160.          }
  161.          if(this.mx_internal::topLevel)
  162.          {
  163.             SystemManagerGlobals.topLevelSystemManagers.push(this);
  164.          }
  165.          stop();
  166.          if(Boolean(root) && Boolean(root.loaderInfo))
  167.          {
  168.             root.loaderInfo.addEventListener(Event.INIT,this.initHandler);
  169.          }
  170.       }
  171.       
  172.       public static function getSWFRoot(param1:Object) : DisplayObject
  173.       {
  174.          var _loc3_:* = undefined;
  175.          var _loc4_:ISystemManager = null;
  176.          var _loc5_:ApplicationDomain = null;
  177.          var _loc6_:Class = null;
  178.          var _loc2_:String = getQualifiedClassName(param1);
  179.          for(_loc3_ in mx_internal::allSystemManagers)
  180.          {
  181.             _loc4_ = _loc3_ as ISystemManager;
  182.             _loc5_ = _loc4_.loaderInfo.applicationDomain;
  183.             try
  184.             {
  185.                _loc6_ = Class(_loc5_.getDefinition(_loc2_));
  186.                if(param1 is _loc6_)
  187.                {
  188.                   return _loc4_ as DisplayObject;
  189.                }
  190.             }
  191.             catch(e:Error)
  192.             {
  193.             }
  194.          }
  195.          return null;
  196.       }
  197.       
  198.       private static function getChildListIndex(param1:IChildList, param2:Object) : int
  199.       {
  200.          var _loc3_:int = -1;
  201.          try
  202.          {
  203.             _loc3_ = param1.getChildIndex(DisplayObject(param2));
  204.          }
  205.          catch(e:ArgumentError)
  206.          {
  207.          }
  208.          return _loc3_;
  209.       }
  210.       
  211.       private function deferredNextFrame() : void
  212.       {
  213.          if(currentFrame + 1 > totalFrames)
  214.          {
  215.             return;
  216.          }
  217.          if(currentFrame + 1 <= framesLoaded)
  218.          {
  219.             nextFrame();
  220.          }
  221.          else
  222.          {
  223.             this.nextFrameTimer = new Timer(100);
  224.             this.nextFrameTimer.addEventListener(TimerEvent.TIMER,this.nextFrameTimerHandler);
  225.             this.nextFrameTimer.start();
  226.          }
  227.       }
  228.       
  229.       override public function get height() : Number
  230.       {
  231.          return this._height;
  232.       }
  233.       
  234.       override public function get stage() : Stage
  235.       {
  236.          var _loc2_:DisplayObject = null;
  237.          if(this._stage)
  238.          {
  239.             return this._stage;
  240.          }
  241.          var _loc1_:Stage = super.stage;
  242.          if(_loc1_)
  243.          {
  244.             this._stage = _loc1_;
  245.             return _loc1_;
  246.          }
  247.          if(!this.mx_internal::topLevel && Boolean(this._topLevelSystemManager))
  248.          {
  249.             this._stage = this._topLevelSystemManager.stage;
  250.             return this._stage;
  251.          }
  252.          if(!this.mx_internal::isStageRoot && this.mx_internal::topLevel)
  253.          {
  254.             _loc2_ = this.getTopLevelRoot();
  255.             if(_loc2_)
  256.             {
  257.                this._stage = _loc2_.stage;
  258.                return this._stage;
  259.             }
  260.          }
  261.          return null;
  262.       }
  263.       
  264.       override public function get width() : Number
  265.       {
  266.          return this._width;
  267.       }
  268.       
  269.       override public function get numChildren() : int
  270.       {
  271.          return this.mx_internal::noTopMostIndex - this.mx_internal::applicationIndex;
  272.       }
  273.       
  274.       public function get allowDomainsInNewRSLs() : Boolean
  275.       {
  276.          return this._allowDomainsInNewRSLs;
  277.       }
  278.       
  279.       public function set allowDomainsInNewRSLs(param1:Boolean) : void
  280.       {
  281.          this._allowDomainsInNewRSLs = param1;
  282.       }
  283.       
  284.       public function get allowInsecureDomainsInNewRSLs() : Boolean
  285.       {
  286.          return this._allowInsecureDomainsInNewRSLs;
  287.       }
  288.       
  289.       public function set allowInsecureDomainsInNewRSLs(param1:Boolean) : void
  290.       {
  291.          this._allowInsecureDomainsInNewRSLs = param1;
  292.       }
  293.       
  294.       public function get application() : IUIComponent
  295.       {
  296.          return IUIComponent(this._document);
  297.       }
  298.       
  299.       mx_internal function get applicationIndex() : int
  300.       {
  301.          return this._applicationIndex;
  302.       }
  303.       
  304.       mx_internal function set applicationIndex(param1:int) : void
  305.       {
  306.          this._applicationIndex = param1;
  307.       }
  308.       
  309.       public function get cursorChildren() : IChildList
  310.       {
  311.          if(!this.mx_internal::topLevel)
  312.          {
  313.             return this._topLevelSystemManager.cursorChildren;
  314.          }
  315.          if(!this._cursorChildren)
  316.          {
  317.             this._cursorChildren = new SystemChildrenList(this,new QName(mx_internal,"toolTipIndex"),new QName(mx_internal,"cursorIndex"));
  318.          }
  319.          return this._cursorChildren;
  320.       }
  321.       
  322.       mx_internal function get cursorIndex() : int
  323.       {
  324.          return this._cursorIndex;
  325.       }
  326.       
  327.       mx_internal function set cursorIndex(param1:int) : void
  328.       {
  329.          var _loc2_:int = param1 - this._cursorIndex;
  330.          this._cursorIndex = param1;
  331.       }
  332.       
  333.       mx_internal function get densityScale() : Number
  334.       {
  335.          var _loc1_:Number = NaN;
  336.          var _loc2_:Number = NaN;
  337.          if(isNaN(this._densityScale))
  338.          {
  339.             _loc1_ = Number(this.info()["applicationDPI"]);
  340.             _loc2_ = DensityUtil.getRuntimeDPI();
  341.             this._densityScale = DensityUtil.getDPIScale(_loc1_,_loc2_);
  342.             if(isNaN(this._densityScale))
  343.             {
  344.                this._densityScale = 1;
  345.             }
  346.          }
  347.          return this._densityScale;
  348.       }
  349.       
  350.       public function get document() : Object
  351.       {
  352.          return this._document;
  353.       }
  354.       
  355.       public function set document(param1:Object) : void
  356.       {
  357.          this._document = param1;
  358.       }
  359.       
  360.       public function get embeddedFontList() : Object
  361.       {
  362.          var _loc1_:Object = null;
  363.          var _loc2_:String = null;
  364.          var _loc3_:Object = null;
  365.          if(this._fontList == null)
  366.          {
  367.             this._fontList = {};
  368.             _loc1_ = this.info()["fonts"];
  369.             for(_loc2_ in _loc1_)
  370.             {
  371.                this._fontList[_loc2_] = _loc1_[_loc2_];
  372.             }
  373.             if(!this.mx_internal::topLevel && Boolean(this._topLevelSystemManager))
  374.             {
  375.                _loc3_ = this._topLevelSystemManager.embeddedFontList;
  376.                for(_loc2_ in _loc3_)
  377.                {
  378.                   this._fontList[_loc2_] = _loc3_[_loc2_];
  379.                }
  380.             }
  381.          }
  382.          return this._fontList;
  383.       }
  384.       
  385.       public function get explicitHeight() : Number
  386.       {
  387.          return this._explicitHeight;
  388.       }
  389.       
  390.       public function set explicitHeight(param1:Number) : void
  391.       {
  392.          this._explicitHeight = param1;
  393.       }
  394.       
  395.       public function get explicitWidth() : Number
  396.       {
  397.          return this._explicitWidth;
  398.       }
  399.       
  400.       public function set explicitWidth(param1:Number) : void
  401.       {
  402.          this._explicitWidth = param1;
  403.       }
  404.       
  405.       public function get focusPane() : Sprite
  406.       {
  407.          return this._focusPane;
  408.       }
  409.       
  410.       public function set focusPane(param1:Sprite) : void
  411.       {
  412.          if(param1)
  413.          {
  414.             this.addChild(param1);
  415.             param1.x = 0;
  416.             param1.y = 0;
  417.             param1.scrollRect = null;
  418.             this._focusPane = param1;
  419.          }
  420.          else
  421.          {
  422.             this.removeChild(this._focusPane);
  423.             this._focusPane = null;
  424.          }
  425.       }
  426.       
  427.       public function get isProxy() : Boolean
  428.       {
  429.          return false;
  430.       }
  431.       
  432.       public function get measuredHeight() : Number
  433.       {
  434.          return !!this.mx_internal::topLevelWindow ? this.mx_internal::topLevelWindow.getExplicitOrMeasuredHeight() : loaderInfo.height;
  435.       }
  436.       
  437.       public function get measuredWidth() : Number
  438.       {
  439.          return !!this.mx_internal::topLevelWindow ? this.mx_internal::topLevelWindow.getExplicitOrMeasuredWidth() : loaderInfo.width;
  440.       }
  441.       
  442.       mx_internal function get noTopMostIndex() : int
  443.       {
  444.          return this._noTopMostIndex;
  445.       }
  446.       
  447.       mx_internal function set noTopMostIndex(param1:int) : void
  448.       {
  449.          var _loc2_:int = param1 - this._noTopMostIndex;
  450.          this._noTopMostIndex = param1;
  451.          this.mx_internal::topMostIndex += _loc2_;
  452.       }
  453.       
  454.       final mx_internal function get $numChildren() : int
  455.       {
  456.          return super.numChildren;
  457.       }
  458.       
  459.       public function get numModalWindows() : int
  460.       {
  461.          return this._numModalWindows;
  462.       }
  463.       
  464.       public function set numModalWindows(param1:int) : void
  465.       {
  466.          this._numModalWindows = param1;
  467.       }
  468.       
  469.       public function get preloadedRSLs() : Dictionary
  470.       {
  471.          return null;
  472.       }
  473.       
  474.       public function addPreloadedRSL(param1:LoaderInfo, param2:Vector.<RSLData>) : void
  475.       {
  476.          var _loc3_:RSLEvent = null;
  477.          this.preloadedRSLs[param1] = param2;
  478.          if(hasEventListener(RSLEvent.RSL_ADD_PRELOADED))
  479.          {
  480.             _loc3_ = new RSLEvent(RSLEvent.RSL_ADD_PRELOADED);
  481.             _loc3_.loaderInfo = param1;
  482.             dispatchEvent(_loc3_);
  483.          }
  484.       }
  485.       
  486.       public function get preloaderBackgroundAlpha() : Number
  487.       {
  488.          return this.info()["backgroundAlpha"];
  489.       }
  490.       
  491.       public function get preloaderBackgroundColor() : uint
  492.       {
  493.          var _loc1_:* = this.info()["backgroundColor"];
  494.          if(_loc1_ == undefined)
  495.          {
  496.             return 4294967295;
  497.          }
  498.          return _loc1_;
  499.       }
  500.       
  501.       public function get preloaderBackgroundImage() : Object
  502.       {
  503.          return this.info()["backgroundImage"];
  504.       }
  505.       
  506.       public function get preloaderBackgroundSize() : String
  507.       {
  508.          return this.info()["backgroundSize"];
  509.       }
  510.       
  511.       public function get popUpChildren() : IChildList
  512.       {
  513.          if(!this.mx_internal::topLevel)
  514.          {
  515.             return this._topLevelSystemManager.popUpChildren;
  516.          }
  517.          if(!this._popUpChildren)
  518.          {
  519.             this._popUpChildren = new SystemChildrenList(this,new QName(mx_internal,"noTopMostIndex"),new QName(mx_internal,"topMostIndex"));
  520.          }
  521.          return this._popUpChildren;
  522.       }
  523.       
  524.       public function get rawChildren() : IChildList
  525.       {
  526.          if(!this._rawChildren)
  527.          {
  528.             this._rawChildren = new SystemRawChildrenList(this);
  529.          }
  530.          return this._rawChildren;
  531.       }
  532.       
  533.       public function get screen() : Rectangle
  534.       {
  535.          if(!this.mx_internal::_screen)
  536.          {
  537.             this.Stage_resizeHandler();
  538.          }
  539.          if(!this.mx_internal::isStageRoot)
  540.          {
  541.             this.Stage_resizeHandler();
  542.          }
  543.          return this.mx_internal::_screen;
  544.       }
  545.       
  546.       public function get toolTipChildren() : IChildList
  547.       {
  548.          if(!this.mx_internal::topLevel)
  549.          {
  550.             return this._topLevelSystemManager.toolTipChildren;
  551.          }
  552.          if(!this._toolTipChildren)
  553.          {
  554.             this._toolTipChildren = new SystemChildrenList(this,new QName(mx_internal,"topMostIndex"),new QName(mx_internal,"toolTipIndex"));
  555.          }
  556.          return this._toolTipChildren;
  557.       }
  558.       
  559.       mx_internal function get toolTipIndex() : int
  560.       {
  561.          return this._toolTipIndex;
  562.       }
  563.       
  564.       mx_internal function set toolTipIndex(param1:int) : void
  565.       {
  566.          var _loc2_:int = param1 - this._toolTipIndex;
  567.          this._toolTipIndex = param1;
  568.          this.mx_internal::cursorIndex += _loc2_;
  569.       }
  570.       
  571.       public function get topLevelSystemManager() : ISystemManager
  572.       {
  573.          if(this.mx_internal::topLevel)
  574.          {
  575.             return this;
  576.          }
  577.          return this._topLevelSystemManager;
  578.       }
  579.       
  580.       mx_internal function get topMostIndex() : int
  581.       {
  582.          return this._topMostIndex;
  583.       }
  584.       
  585.       mx_internal function set topMostIndex(param1:int) : void
  586.       {
  587.          var _loc2_:int = param1 - this._topMostIndex;
  588.          this._topMostIndex = param1;
  589.          this.mx_internal::toolTipIndex += _loc2_;
  590.       }
  591.       
  592.       final mx_internal function $addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
  593.       {
  594.          super.addEventListener(param1,param2,param3,param4,param5);
  595.       }
  596.       
  597.       public function get childAllowsParent() : Boolean
  598.       {
  599.          try
  600.          {
  601.             return loaderInfo.childAllowsParent;
  602.          }
  603.          catch(error:Error)
  604.          {
  605.          }
  606.          return false;
  607.       }
  608.       
  609.       public function get parentAllowsChild() : Boolean
  610.       {
  611.          try
  612.          {
  613.             return loaderInfo.parentAllowsChild;
  614.          }
  615.          catch(error:Error)
  616.          {
  617.          }
  618.          return false;
  619.       }
  620.       
  621.       override public function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
  622.       {
  623.          var request:DynamicEvent = null;
  624.          var type:String = param1;
  625.          var listener:Function = param2;
  626.          var useCapture:Boolean = param3;
  627.          var priority:int = param4;
  628.          var useWeakReference:Boolean = param5;
  629.          if(type == MouseEvent.MOUSE_MOVE || type == MouseEvent.MOUSE_UP || type == MouseEvent.MOUSE_DOWN || type == Event.ACTIVATE || type == Event.DEACTIVATE)
  630.          {
  631.             try
  632.             {
  633.                if(this.stage)
  634.                {
  635.                   this.stage.addEventListener(type,this.stageEventHandler,false,0,true);
  636.                }
  637.             }
  638.             catch(error:SecurityError)
  639.             {
  640.             }
  641.          }
  642.          if(hasEventListener("addEventListener"))
  643.          {
  644.             request = new DynamicEvent("addEventListener",false,true);
  645.             request.eventType = type;
  646.             request.listener = listener;
  647.             request.useCapture = useCapture;
  648.             request.priority = priority;
  649.             request.useWeakReference = useWeakReference;
  650.             if(!dispatchEvent(request))
  651.             {
  652.                return;
  653.             }
  654.          }
  655.          if(type == SandboxMouseEvent.MOUSE_UP_SOMEWHERE)
  656.          {
  657.             try
  658.             {
  659.                if(this.stage)
  660.                {
  661.                   this.stage.addEventListener(Event.MOUSE_LEAVE,this.mouseLeaveHandler,false,0,true);
  662.                }
  663.                else
  664.                {
  665.                   super.addEventListener(Event.MOUSE_LEAVE,this.mouseLeaveHandler,false,0,true);
  666.                }
  667.             }
  668.             catch(error:SecurityError)
  669.             {
  670.                super.addEventListener(Event.MOUSE_LEAVE,mouseLeaveHandler,false,0,true);
  671.             }
  672.          }
  673.          if(type == FlexEvent.RENDER || type == FlexEvent.ENTER_FRAME)
  674.          {
  675.             if(type == FlexEvent.RENDER)
  676.             {
  677.                type = Event.RENDER;
  678.             }
  679.             else
  680.             {
  681.                type = Event.ENTER_FRAME;
  682.             }
  683.             try
  684.             {
  685.                if(this.stage)
  686.                {
  687.                   this.stage.addEventListener(type,listener,useCapture,priority,useWeakReference);
  688.                }
  689.                else
  690.                {
  691.                   super.addEventListener(type,listener,useCapture,priority,useWeakReference);
  692.                }
  693.             }
  694.             catch(error:SecurityError)
  695.             {
  696.                super.addEventListener(type,listener,useCapture,priority,useWeakReference);
  697.             }
  698.             if(Boolean(this.stage) && type == Event.RENDER)
  699.             {
  700.                this.stage.invalidate();
  701.             }
  702.             return;
  703.          }
  704.          if(type == FlexEvent.IDLE && !this.idleTimer)
  705.          {
  706.             this.idleTimer = new Timer(IDLE_INTERVAL);
  707.             this.idleTimer.addEventListener(TimerEvent.TIMER,this.idleTimer_timerHandler);
  708.             this.idleTimer.start();
  709.             this.addEventListener(MouseEvent.MOUSE_MOVE,this.mouseMoveHandler,true);
  710.             this.addEventListener(MouseEvent.MOUSE_UP,this.mouseUpHandler,true);
  711.          }
  712.          super.addEventListener(type,listener,useCapture,priority,useWeakReference);
  713.       }
  714.       
  715.       final mx_internal function $removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
  716.       {
  717.          super.removeEventListener(param1,param2,param3);
  718.       }
  719.       
  720.       override public function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
  721.       {
  722.          var _loc4_:DynamicEvent = null;
  723.          if(hasEventListener("removeEventListener"))
  724.          {
  725.             _loc4_ = new DynamicEvent("removeEventListener",false,true);
  726.             _loc4_.eventType = param1;
  727.             _loc4_.listener = param2;
  728.             _loc4_.useCapture = param3;
  729.             if(!dispatchEvent(_loc4_))
  730.             {
  731.                return;
  732.             }
  733.          }
  734.          if(param1 == FlexEvent.RENDER || param1 == FlexEvent.ENTER_FRAME)
  735.          {
  736.             if(param1 == FlexEvent.RENDER)
  737.             {
  738.                param1 = Event.RENDER;
  739.             }
  740.             else
  741.             {
  742.                param1 = Event.ENTER_FRAME;
  743.             }
  744.             try
  745.             {
  746.                if(this.stage)
  747.                {
  748.                   this.stage.removeEventListener(param1,param2,param3);
  749.                }
  750.             }
  751.             catch(error:SecurityError)
  752.             {
  753.             }
  754.             super.removeEventListener(param1,param2,param3);
  755.             return;
  756.          }
  757.          if(param1 == FlexEvent.IDLE)
  758.          {
  759.             super.removeEventListener(param1,param2,param3);
  760.             if(!hasEventListener(FlexEvent.IDLE) && Boolean(this.idleTimer))
  761.             {
  762.                this.idleTimer.stop();
  763.                this.idleTimer = null;
  764.                this.removeEventListener(MouseEvent.MOUSE_MOVE,this.mouseMoveHandler);
  765.                this.removeEventListener(MouseEvent.MOUSE_UP,this.mouseUpHandler);
  766.             }
  767.          }
  768.          else
  769.          {
  770.             super.removeEventListener(param1,param2,param3);
  771.          }
  772.          if(param1 == MouseEvent.MOUSE_MOVE || param1 == MouseEvent.MOUSE_UP || param1 == MouseEvent.MOUSE_DOWN || param1 == Event.ACTIVATE || param1 == Event.DEACTIVATE)
  773.          {
  774.             if(!hasEventListener(param1))
  775.             {
  776.                try
  777.                {
  778.                   if(this.stage)
  779.                   {
  780.                      this.stage.removeEventListener(param1,this.stageEventHandler,false);
  781.                   }
  782.                }
  783.                catch(error:SecurityError)
  784.                {
  785.                }
  786.             }
  787.          }
  788.          if(param1 == SandboxMouseEvent.MOUSE_UP_SOMEWHERE)
  789.          {
  790.             if(!hasEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE))
  791.             {
  792.                try
  793.                {
  794.                   if(this.stage)
  795.                   {
  796.                      this.stage.removeEventListener(Event.MOUSE_LEAVE,this.mouseLeaveHandler);
  797.                   }
  798.                }
  799.                catch(error:SecurityError)
  800.                {
  801.                }
  802.                super.removeEventListener(Event.MOUSE_LEAVE,this.mouseLeaveHandler);
  803.             }
  804.          }
  805.       }
  806.       
  807.       override public function addChild(param1:DisplayObject) : DisplayObject
  808.       {
  809.          var _loc2_:int = this.numChildren;
  810.          if(param1.parent == this)
  811.          {
  812.             _loc2_--;
  813.          }
  814.          return this.addChildAt(param1,_loc2_);
  815.       }
  816.       
  817.       override public function addChildAt(param1:DisplayObject, param2:int) : DisplayObject
  818.       {
  819.          ++this.mx_internal::noTopMostIndex;
  820.          var _loc3_:DisplayObjectContainer = param1.parent;
  821.          if(_loc3_)
  822.          {
  823.             _loc3_.removeChild(param1);
  824.          }
  825.          return this.mx_internal::rawChildren_addChildAt(param1,this.mx_internal::applicationIndex + param2);
  826.       }
  827.       
  828.       final mx_internal function $addChildAt(param1:DisplayObject, param2:int) : DisplayObject
  829.       {
  830.          return super.addChildAt(param1,param2);
  831.       }
  832.       
  833.       final mx_internal function $removeChildAt(param1:int) : DisplayObject
  834.       {
  835.          return super.removeChildAt(param1);
  836.       }
  837.       
  838.       override public function removeChild(param1:DisplayObject) : DisplayObject
  839.       {
  840.          --this.mx_internal::noTopMostIndex;
  841.          return this.mx_internal::rawChildren_removeChild(param1);
  842.       }
  843.       
  844.       override public function removeChildAt(param1:int) : DisplayObject
  845.       {
  846.          --this.mx_internal::noTopMostIndex;
  847.          return this.mx_internal::rawChildren_removeChildAt(this.mx_internal::applicationIndex + param1);
  848.       }
  849.       
  850.       override public function getChildAt(param1:int) : DisplayObject
  851.       {
  852.          return super.getChildAt(this.mx_internal::applicationIndex + param1);
  853.       }
  854.       
  855.       override public function getChildByName(param1:String) : DisplayObject
  856.       {
  857.          return super.getChildByName(param1);
  858.       }
  859.       
  860.       override public function getChildIndex(param1:DisplayObject) : int
  861.       {
  862.          return super.getChildIndex(param1) - this.mx_internal::applicationIndex;
  863.       }
  864.       
  865.       override public function setChildIndex(param1:DisplayObject, param2:int) : void
  866.       {
  867.          super.setChildIndex(param1,this.mx_internal::applicationIndex + param2);
  868.       }
  869.       
  870.       override public function getObjectsUnderPoint(param1:Point) : Array
  871.       {
  872.          var _loc5_:DisplayObject = null;
  873.          var _loc6_:Array = null;
  874.          var _loc2_:Array = [];
  875.          var _loc3_:int = this.mx_internal::topMostIndex;
  876.          var _loc4_:int = 0;
  877.          while(_loc4_ < _loc3_)
  878.          {
  879.             _loc5_ = super.getChildAt(_loc4_);
  880.             if(_loc5_ is DisplayObjectContainer)
  881.             {
  882.                _loc6_ = DisplayObjectContainer(_loc5_).getObjectsUnderPoint(param1);
  883.                if(_loc6_)
  884.                {
  885.                   _loc2_ = _loc2_.concat(_loc6_);
  886.                }
  887.             }
  888.             _loc4_++;
  889.          }
  890.          return _loc2_;
  891.       }
  892.       
  893.       override public function contains(param1:DisplayObject) : Boolean
  894.       {
  895.          var _loc2_:int = 0;
  896.          var _loc3_:int = 0;
  897.          var _loc4_:DisplayObject = null;
  898.          if(super.contains(param1))
  899.          {
  900.             if(param1.parent == this)
  901.             {
  902.                _loc2_ = super.getChildIndex(param1);
  903.                if(_loc2_ < this.mx_internal::noTopMostIndex)
  904.                {
  905.                   return true;
  906.                }
  907.             }
  908.             else
  909.             {
  910.                _loc3_ = 0;
  911.                while(_loc3_ < this.mx_internal::noTopMostIndex)
  912.                {
  913.                   _loc4_ = super.getChildAt(_loc3_);
  914.                   if(_loc4_ is IRawChildrenContainer)
  915.                   {
  916.                      if(IRawChildrenContainer(_loc4_).rawChildren.contains(param1))
  917.                      {
  918.                         return true;
  919.                      }
  920.                   }
  921.                   if(_loc4_ is DisplayObjectContainer)
  922.                   {
  923.                      if(DisplayObjectContainer(_loc4_).contains(param1))
  924.                      {
  925.                         return true;
  926.                      }
  927.                   }
  928.                   _loc3_++;
  929.                }
  930.             }
  931.          }
  932.          return false;
  933.       }
  934.       
  935.       public function callInContext(param1:Function, param2:Object, param3:Array, param4:Boolean = true) : *
  936.       {
  937.          return undefined;
  938.       }
  939.       
  940.       public function create(... rest) : Object
  941.       {
  942.          var _loc4_:String = null;
  943.          var _loc5_:int = 0;
  944.          var _loc6_:int = 0;
  945.          var _loc2_:String = this.info()["mainClassName"];
  946.          if(_loc2_ == null)
  947.          {
  948.             _loc4_ = loaderInfo.loaderURL;
  949.             _loc5_ = int(_loc4_.lastIndexOf("."));
  950.             _loc6_ = int(_loc4_.lastIndexOf("/"));
  951.             _loc2_ = _loc4_.substring(_loc6_ + 1,_loc5_);
  952.          }
  953.          var _loc3_:Class = Class(this.getDefinitionByName(_loc2_));
  954.          return !!_loc3_ ? new _loc3_() : null;
  955.       }
  956.       
  957.       public function info() : Object
  958.       {
  959.          return {};
  960.       }
  961.       
  962.       mx_internal function initialize() : void
  963.       {
  964.          var _loc7_:int = 0;
  965.          var _loc8_:int = 0;
  966.          var _loc12_:String = null;
  967.          var _loc13_:Class = null;
  968.          var _loc14_:Array = null;
  969.          var _loc15_:Object = null;
  970.          var _loc16_:RSLItem = null;
  971.          var _loc1_:Class = this.info()["runtimeDPIProvider"] as Class;
  972.          if(_loc1_)
  973.          {
  974.             Singleton.registerClass("mx.core::RuntimeDPIProvider",_loc1_);
  975.          }
  976.          if(this.mx_internal::isStageRoot)
  977.          {
  978.             this.Stage_resizeHandler();
  979.          }
  980.          else
  981.          {
  982.             this._width = loaderInfo.width;
  983.             this._height = loaderInfo.height;
  984.          }
  985.          this.mx_internal::preloader = new Preloader();
  986.          this.mx_internal::preloader.addEventListener(FlexEvent.PRELOADER_DOC_FRAME_READY,this.preloader_preloaderDocFrameReadyHandler);
  987.          this.mx_internal::preloader.addEventListener(Event.COMPLETE,this.mx_internal::preloader_completeHandler);
  988.          this.mx_internal::preloader.addEventListener(FlexEvent.PRELOADER_DONE,this.preloader_preloaderDoneHandler);
  989.          this.mx_internal::preloader.addEventListener(RSLEvent.RSL_COMPLETE,this.preloader_rslCompleteHandler);
  990.          if(!this._popUpChildren)
  991.          {
  992.             this._popUpChildren = new SystemChildrenList(this,new QName(mx_internal,"noTopMostIndex"),new QName(mx_internal,"topMostIndex"));
  993.          }
  994.          this._popUpChildren.addChild(this.mx_internal::preloader);
  995.          var _loc2_:Array = this.info()["rsls"];
  996.          var _loc3_:Array = this.info()["cdRsls"];
  997.          var _loc4_:Boolean = true;
  998.          if(this.info()["usePreloader"] != undefined)
  999.          {
  1000.             _loc4_ = Boolean(this.info()["usePreloader"]);
  1001.          }
  1002.          var _loc5_:Class = this.info()["preloader"] as Class;
  1003.          var _loc6_:Array = [];
  1004.          if(Boolean(_loc3_) && _loc3_.length > 0)
  1005.          {
  1006.             if(this.isTopLevel())
  1007.             {
  1008.                this.rslDataList = _loc3_;
  1009.             }
  1010.             else
  1011.             {
  1012.                this.rslDataList = LoaderUtil.mx_internal::processRequiredRSLs(this,_loc3_);
  1013.             }
  1014.             _loc12_ = LoaderUtil.normalizeURL(this.loaderInfo);
  1015.             _loc13_ = Class(this.getDefinitionByName("mx.core::CrossDomainRSLItem"));
  1016.             _loc7_ = int(this.rslDataList.length);
  1017.             _loc8_ = 0;
  1018.             while(_loc8_ < _loc7_)
  1019.             {
  1020.                _loc14_ = this.rslDataList[_loc8_];
  1021.                _loc15_ = new _loc13_(_loc14_,_loc12_,this);
  1022.                _loc6_.push(_loc15_);
  1023.                _loc8_++;
  1024.             }
  1025.          }
  1026.          if(_loc2_ != null && _loc2_.length > 0)
  1027.          {
  1028.             if(this.rslDataList == null)
  1029.             {
  1030.                this.rslDataList = [];
  1031.             }
  1032.             if(_loc12_ == null)
  1033.             {
  1034.                _loc12_ = LoaderUtil.normalizeURL(this.loaderInfo);
  1035.             }
  1036.             _loc7_ = int(_loc2_.length);
  1037.             _loc8_ = 0;
  1038.             while(_loc8_ < _loc7_)
  1039.             {
  1040.                _loc16_ = new RSLItem(_loc2_[_loc8_].url,_loc12_,this);
  1041.                _loc6_.push(_loc16_);
  1042.                this.rslDataList.push([new RSLData(_loc2_[_loc8_].url,null,null,null,false,false,"current")]);
  1043.                _loc8_++;
  1044.             }
  1045.          }
  1046.          var _loc9_:String = loaderInfo.parameters["resourceModuleURLs"];
  1047.          var _loc10_:Array = !!_loc9_ ? _loc9_.split(",") : null;
  1048.          var _loc11_:ApplicationDomain = !this.mx_internal::topLevel && this.parent is Loader ? Loader(this.parent).contentLoaderInfo.applicationDomain : this.info()["currentDomain"] as ApplicationDomain;
  1049.          this.mx_internal::preloader.initialize(_loc4_,_loc5_,this.preloaderBackgroundColor,this.preloaderBackgroundAlpha,this.preloaderBackgroundImage,this.preloaderBackgroundSize,this.mx_internal::isStageRoot ? this.stage.stageWidth : loaderInfo.width,this.mx_internal::isStageRoot ? this.stage.stageHeight : loaderInfo.height,null,null,_loc6_,_loc10_,_loc11_);
  1050.       }
  1051.       
  1052.       mx_internal function rawChildren_addChild(param1:DisplayObject) : DisplayObject
  1053.       {
  1054.          this.mx_internal::childManager.addingChild(param1);
  1055.          super.addChild(param1);
  1056.          this.mx_internal::childManager.childAdded(param1);
  1057.          return param1;
  1058.       }
  1059.       
  1060.       mx_internal function rawChildren_addChildAt(param1:DisplayObject, param2:int) : DisplayObject
  1061.       {
  1062.          if(this.mx_internal::childManager)
  1063.          {
  1064.             this.mx_internal::childManager.addingChild(param1);
  1065.          }
  1066.          super.addChildAt(param1,param2);
  1067.          if(this.mx_internal::childManager)
  1068.          {
  1069.             this.mx_internal::childManager.childAdded(param1);
  1070.          }
  1071.          return param1;
  1072.       }
  1073.       
  1074.       mx_internal function rawChildren_removeChild(param1:DisplayObject) : DisplayObject
  1075.       {
  1076.          this.mx_internal::childManager.removingChild(param1);
  1077.          super.removeChild(param1);
  1078.          this.mx_internal::childManager.childRemoved(param1);
  1079.          return param1;
  1080.       }
  1081.       
  1082.       mx_internal function rawChildren_removeChildAt(param1:int) : DisplayObject
  1083.       {
  1084.          var _loc2_:DisplayObject = super.getChildAt(param1);
  1085.          this.mx_internal::childManager.removingChild(_loc2_);
  1086.          super.removeChildAt(param1);
  1087.          this.mx_internal::childManager.childRemoved(_loc2_);
  1088.          return _loc2_;
  1089.       }
  1090.       
  1091.       mx_internal function rawChildren_getChildAt(param1:int) : DisplayObject
  1092.       {
  1093.          return super.getChildAt(param1);
  1094.       }
  1095.       
  1096.       mx_internal function rawChildren_getChildByName(param1:String) : DisplayObject
  1097.       {
  1098.          return super.getChildByName(param1);
  1099.       }
  1100.       
  1101.       mx_internal function rawChildren_getChildIndex(param1:DisplayObject) : int
  1102.       {
  1103.          return super.getChildIndex(param1);
  1104.       }
  1105.       
  1106.       mx_internal function rawChildren_setChildIndex(param1:DisplayObject, param2:int) : void
  1107.       {
  1108.          super.setChildIndex(param1,param2);
  1109.       }
  1110.       
  1111.       mx_internal function rawChildren_getObjectsUnderPoint(param1:Point) : Array
  1112.       {
  1113.          return super.getObjectsUnderPoint(param1);
  1114.       }
  1115.       
  1116.       mx_internal function rawChildren_contains(param1:DisplayObject) : Boolean
  1117.       {
  1118.          return super.contains(param1);
  1119.       }
  1120.       
  1121.       public function allowDomain(... rest) : void
  1122.       {
  1123.       }
  1124.       
  1125.       public function allowInsecureDomain(... rest) : void
  1126.       {
  1127.       }
  1128.       
  1129.       public function getExplicitOrMeasuredWidth() : Number
  1130.       {
  1131.          return !isNaN(this.explicitWidth) ? this.explicitWidth : this.measuredWidth;
  1132.       }
  1133.       
  1134.       public function getExplicitOrMeasuredHeight() : Number
  1135.       {
  1136.          return !isNaN(this.explicitHeight) ? this.explicitHeight : this.measuredHeight;
  1137.       }
  1138.       
  1139.       public function move(param1:Number, param2:Number) : void
  1140.       {
  1141.       }
  1142.       
  1143.       public function setActualSize(param1:Number, param2:Number) : void
  1144.       {
  1145.          if(this.mx_internal::isStageRoot)
  1146.          {
  1147.             return;
  1148.          }
  1149.          if(this.mouseCatcher)
  1150.          {
  1151.             this.mouseCatcher.width = param1;
  1152.             this.mouseCatcher.height = param2;
  1153.          }
  1154.          if(this._width != param1 || this._height != param2)
  1155.          {
  1156.             this._width = param1;
  1157.             this._height = param2;
  1158.             dispatchEvent(new Event(Event.RESIZE));
  1159.          }
  1160.       }
  1161.       
  1162.       public function getDefinitionByName(param1:String) : Object
  1163.       {
  1164.          var _loc3_:Object = null;
  1165.          var _loc2_:ApplicationDomain = !this.mx_internal::topLevel && this.parent is Loader ? Loader(this.parent).contentLoaderInfo.applicationDomain : this.info()["currentDomain"] as ApplicationDomain;
  1166.          if(_loc2_.hasDefinition(param1))
  1167.          {
  1168.             _loc3_ = _loc2_.getDefinition(param1);
  1169.          }
  1170.          return _loc3_;
  1171.       }
  1172.       
  1173.       public function isTopLevel() : Boolean
  1174.       {
  1175.          return this.mx_internal::topLevel;
  1176.       }
  1177.       
  1178.       public function isTopLevelRoot() : Boolean
  1179.       {
  1180.          return this.mx_internal::isStageRoot || this.mx_internal::isBootstrapRoot;
  1181.       }
  1182.       
  1183.       public function isTopLevelWindow(param1:DisplayObject) : Boolean
  1184.       {
  1185.          return param1 is IUIComponent && IUIComponent(param1) == this.mx_internal::topLevelWindow;
  1186.       }
  1187.       
  1188.       public function isFontFaceEmbedded(param1:TextFormat) : Boolean
  1189.       {
  1190.          var _loc9_:Font = null;
  1191.          var _loc10_:String = null;
  1192.          var _loc2_:String = param1.font;
  1193.          var _loc3_:Boolean = Boolean(param1.bold);
  1194.          var _loc4_:Boolean = Boolean(param1.italic);
  1195.          var _loc5_:Array = Font.enumerateFonts();
  1196.          var _loc6_:int = int(_loc5_.length);
  1197.          var _loc7_:int = 0;
  1198.          while(_loc7_ < _loc6_)
  1199.          {
  1200.             _loc9_ = Font(_loc5_[_loc7_]);
  1201.             if(_loc9_.fontName == _loc2_)
  1202.             {
  1203.                _loc10_ = "regular";
  1204.                if(_loc3_ && _loc4_)
  1205.                {
  1206.                   _loc10_ = "boldItalic";
  1207.                }
  1208.                else if(_loc3_)
  1209.                {
  1210.                   _loc10_ = "bold";
  1211.                }
  1212.                else if(_loc4_)
  1213.                {
  1214.                   _loc10_ = "italic";
  1215.                }
  1216.                if(_loc9_.fontStyle == _loc10_)
  1217.                {
  1218.                   return true;
  1219.                }
  1220.             }
  1221.             _loc7_++;
  1222.          }
  1223.          if(!_loc2_ || !this.embeddedFontList || !this.embeddedFontList[_loc2_])
  1224.          {
  1225.             return false;
  1226.          }
  1227.          var _loc8_:Object = this.embeddedFontList[_loc2_];
  1228.          return !(_loc3_ && !_loc8_.bold || _loc4_ && !_loc8_.italic || !_loc3_ && !_loc4_ && !_loc8_.regular);
  1229.       }
  1230.       
  1231.       private function resizeMouseCatcher() : void
  1232.       {
  1233.          var _loc1_:Graphics = null;
  1234.          var _loc2_:Rectangle = null;
  1235.          if(this.mouseCatcher)
  1236.          {
  1237.             try
  1238.             {
  1239.                _loc1_ = this.mouseCatcher.graphics;
  1240.                _loc2_ = this.screen;
  1241.                _loc1_.clear();
  1242.                _loc1_.beginFill(0,0);
  1243.                _loc1_.drawRect(0,0,_loc2_.width,_loc2_.height);
  1244.                _loc1_.endFill();
  1245.             }
  1246.             catch(e:SecurityError)
  1247.             {
  1248.             }
  1249.          }
  1250.       }
  1251.       
  1252.       private function initHandler(param1:Event) : void
  1253.       {
  1254.          if(!this.mx_internal::isStageRoot)
  1255.          {
  1256.             if(root.loaderInfo.parentAllowsChild)
  1257.             {
  1258.                try
  1259.                {
  1260.                   if(!this.parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot",false,true)) || !root.loaderInfo.sharedEvents.hasEventListener("bridgeNewApplication"))
  1261.                   {
  1262.                      this.mx_internal::isBootstrapRoot = true;
  1263.                   }
  1264.                }
  1265.                catch(e:Error)
  1266.                {
  1267.                }
  1268.             }
  1269.          }
  1270.          mx_internal::allSystemManagers[this] = this.loaderInfo.url;
  1271.          root.loaderInfo.removeEventListener(Event.INIT,this.initHandler);
  1272.          if(!SystemManagerGlobals.info)
  1273.          {
  1274.             SystemManagerGlobals.info = this.info();
  1275.          }
  1276.          if(!SystemManagerGlobals.parameters)
  1277.          {
  1278.             SystemManagerGlobals.parameters = loaderInfo.parameters;
  1279.          }
  1280.          var _loc2_:int = totalFrames == 1 ? 0 : 1;
  1281.          this.addEventListener(Event.ENTER_FRAME,this.docFrameListener);
  1282.          this.mx_internal::initialize();
  1283.       }
  1284.       
  1285.       private function docFrameListener(param1:Event) : void
  1286.       {
  1287.          if(currentFrame == 2)
  1288.          {
  1289.             this.removeEventListener(Event.ENTER_FRAME,this.docFrameListener);
  1290.             if(totalFrames > 2)
  1291.             {
  1292.                this.addEventListener(Event.ENTER_FRAME,this.extraFrameListener);
  1293.             }
  1294.             this.mx_internal::docFrameHandler();
  1295.          }
  1296.       }
  1297.       
  1298.       private function extraFrameListener(param1:Event) : void
  1299.       {
  1300.          if(this.lastFrame == currentFrame)
  1301.          {
  1302.             return;
  1303.          }
  1304.          this.lastFrame = currentFrame;
  1305.          if(currentFrame + 1 > totalFrames)
  1306.          {
  1307.             this.removeEventListener(Event.ENTER_FRAME,this.extraFrameListener);
  1308.          }
  1309.          this.extraFrameHandler();
  1310.       }
  1311.       
  1312.       private function preloader_preloaderDocFrameReadyHandler(param1:Event) : void
  1313.       {
  1314.          this.mx_internal::preloader.removeEventListener(FlexEvent.PRELOADER_DOC_FRAME_READY,this.preloader_preloaderDocFrameReadyHandler);
  1315.          this.deferredNextFrame();
  1316.       }
  1317.       
  1318.       private function preloader_preloaderDoneHandler(param1:Event) : void
  1319.       {
  1320.          var _loc2_:IUIComponent = this.mx_internal::topLevelWindow;
  1321.          this.mx_internal::preloader.removeEventListener(FlexEvent.PRELOADER_DONE,this.preloader_preloaderDoneHandler);
  1322.          this.mx_internal::preloader.removeEventListener(RSLEvent.RSL_COMPLETE,this.preloader_rslCompleteHandler);
  1323.          this._popUpChildren.removeChild(this.mx_internal::preloader);
  1324.          this.mx_internal::preloader = null;
  1325.          this.mouseCatcher = new FlexSprite();
  1326.          this.mouseCatcher.name = "mouseCatcher";
  1327.          ++this.mx_internal::noTopMostIndex;
  1328.          super.addChildAt(this.mouseCatcher,0);
  1329.          this.resizeMouseCatcher();
  1330.          if(!this.mx_internal::topLevel)
  1331.          {
  1332.             this.mouseCatcher.visible = false;
  1333.             mask = this.mouseCatcher;
  1334.          }
  1335.          ++this.mx_internal::noTopMostIndex;
  1336.          super.addChildAt(DisplayObject(_loc2_),1);
  1337.          _loc2_.dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
  1338.          dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
  1339.       }
  1340.       
  1341.       private function preloader_rslCompleteHandler(param1:RSLEvent) : void
  1342.       {
  1343.          var _loc2_:Vector.<RSLData> = null;
  1344.          var _loc3_:IFlexModuleFactory = null;
  1345.          if(!param1.isResourceModule && Boolean(param1.loaderInfo))
  1346.          {
  1347.             _loc2_ = Vector.<RSLData>(this.rslDataList[param1.rslIndex]);
  1348.             _loc3_ = this;
  1349.             if(Boolean(_loc2_) && Boolean(_loc2_[0].moduleFactory))
  1350.             {
  1351.                _loc3_ = _loc2_[0].moduleFactory;
  1352.             }
  1353.             if(_loc3_ == this)
  1354.             {
  1355.                this.preloadedRSLs[param1.loaderInfo] = _loc2_;
  1356.             }
  1357.             else
  1358.             {
  1359.                _loc3_.addPreloadedRSL(param1.loaderInfo,_loc2_);
  1360.             }
  1361.          }
  1362.       }
  1363.       
  1364.       mx_internal function docFrameHandler(param1:Event = null) : void
  1365.       {
  1366.          if(this.readyForKickOff)
  1367.          {
  1368.             this.mx_internal::kickOff();
  1369.          }
  1370.       }
  1371.       
  1372.       mx_internal function preloader_completeHandler(param1:Event) : void
  1373.       {
  1374.          this.mx_internal::preloader.removeEventListener(Event.COMPLETE,this.mx_internal::preloader_completeHandler);
  1375.          this.readyForKickOff = true;
  1376.          if(currentFrame >= 2)
  1377.          {
  1378.             this.mx_internal::kickOff();
  1379.          }
  1380.       }
  1381.       
  1382.       mx_internal function kickOff() : void
  1383.       {
  1384.          var _loc5_:int = 0;
  1385.          var _loc6_:int = 0;
  1386.          var _loc7_:Class = null;
  1387.          if(this.document)
  1388.          {
  1389.             return;
  1390.          }
  1391.          if(!this.isTopLevel())
  1392.          {
  1393.             SystemManagerGlobals.topLevelSystemManagers[0].dispatchEvent(new FocusEvent(FlexEvent.NEW_CHILD_APPLICATION,false,false,this));
  1394.          }
  1395.          Singleton.registerClass("mx.core::IEmbeddedFontRegistry",Class(this.getDefinitionByName("mx.core::EmbeddedFontRegistry")));
  1396.          Singleton.registerClass("mx.styles::IStyleManager",Class(this.getDefinitionByName("mx.styles::StyleManagerImpl")));
  1397.          Singleton.registerClass("mx.styles::IStyleManager2",Class(this.getDefinitionByName("mx.styles::StyleManagerImpl")));
  1398.          Singleton.registerClass("mx.managers::IBrowserManager",Class(this.getDefinitionByName("mx.managers::BrowserManagerImpl")));
  1399.          Singleton.registerClass("mx.managers::ICursorManager",Class(this.getDefinitionByName("mx.managers::CursorManagerImpl")));
  1400.          Singleton.registerClass("mx.managers::IHistoryManager",Class(this.getDefinitionByName("mx.managers::HistoryManagerImpl")));
  1401.          Singleton.registerClass("mx.managers::ILayoutManager",Class(this.getDefinitionByName("mx.managers::LayoutManager")));
  1402.          Singleton.registerClass("mx.managers::IPopUpManager",Class(this.getDefinitionByName("mx.managers::PopUpManagerImpl")));
  1403.          Singleton.registerClass("mx.managers::IToolTipManager2",Class(this.getDefinitionByName("mx.managers::ToolTipManagerImpl")));
  1404.          var _loc1_:Class = null;
  1405.          var _loc2_:Object = this.info()["useNativeDragManager"];
  1406.          var _loc3_:Boolean = _loc2_ == null ? true : String(_loc2_) == "true";
  1407.          if(_loc3_)
  1408.          {
  1409.             _loc1_ = Class(this.getDefinitionByName("mx.managers::NativeDragManagerImpl"));
  1410.          }
  1411.          if(_loc1_ == null)
  1412.          {
  1413.             _loc1_ = Class(this.getDefinitionByName("mx.managers::DragManagerImpl"));
  1414.          }
  1415.          Singleton.registerClass("mx.managers::IDragManager",_loc1_);
  1416.          Singleton.registerClass("mx.core::ITextFieldFactory",Class(this.getDefinitionByName("mx.core::TextFieldFactory")));
  1417.          var _loc4_:Array = this.info()["mixins"];
  1418.          if((Boolean(_loc4_)) && _loc4_.length > 0)
  1419.          {
  1420.             _loc5_ = int(_loc4_.length);
  1421.             _loc6_ = 0;
  1422.             while(_loc6_ < _loc5_)
  1423.             {
  1424.                _loc7_ = Class(this.getDefinitionByName(_loc4_[_loc6_]));
  1425.                _loc7_["init"](this);
  1426.                _loc6_++;
  1427.             }
  1428.          }
  1429.          _loc7_ = Singleton.getClass("mx.managers::IActiveWindowManager");
  1430.          if(_loc7_)
  1431.          {
  1432.             this.registerImplementation("mx.managers::IActiveWindowManager",new _loc7_(this));
  1433.          }
  1434.          _loc7_ = Singleton.getClass("mx.managers::IMarshalSystemManager");
  1435.          if(_loc7_)
  1436.          {
  1437.             this.registerImplementation("mx.managers::IMarshalSystemManager",new _loc7_(this));
  1438.          }
  1439.          this.initializeTopLevelWindow(null);
  1440.          this.deferredNextFrame();
  1441.       }
  1442.       
  1443.       private function keyDownHandler(param1:KeyboardEvent) : void
  1444.       {
  1445.          var _loc2_:KeyboardEvent = null;
  1446.          if(!param1.cancelable)
  1447.          {
  1448.             switch(param1.keyCode)
  1449.             {
  1450.                case Keyboard.UP:
  1451.                case Keyboard.DOWN:
  1452.                case Keyboard.PAGE_UP:
  1453.                case Keyboard.PAGE_DOWN:
  1454.                case Keyboard.HOME:
  1455.                case Keyboard.END:
  1456.                case Keyboard.LEFT:
  1457.                case Keyboard.RIGHT:
  1458.                case Keyboard.ENTER:
  1459.                   param1.stopImmediatePropagation();
  1460.                   _loc2_ = new KeyboardEvent(param1.type,param1.bubbles,true,param1.charCode,param1.keyCode,param1.keyLocation,param1.ctrlKey,param1.altKey,param1.shiftKey);
  1461.                   param1.target.dispatchEvent(_loc2_);
  1462.             }
  1463.          }
  1464.       }
  1465.       
  1466.       private function mouseEventHandler(param1:MouseEvent) : void
  1467.       {
  1468.          var _loc2_:MouseEvent = null;
  1469.          var _loc3_:Class = null;
  1470.          if(!param1.cancelable)
  1471.          {
  1472.             param1.stopImmediatePropagation();
  1473.             _loc2_ = null;
  1474.             if("clickCount" in param1)
  1475.             {
  1476.                _loc3_ = MouseEvent;
  1477.                _loc2_ = new _loc3_(param1.type,param1.bubbles,true,param1.localX,param1.localY,param1.relatedObject,param1.ctrlKey,param1.altKey,param1.shiftKey,param1.buttonDown,param1.delta,param1["commandKey"],param1["controlKey"],param1["clickCount"]);
  1478.             }
  1479.             else
  1480.             {
  1481.                _loc2_ = new MouseEvent(param1.type,param1.bubbles,true,param1.localX,param1.localY,param1.relatedObject,param1.ctrlKey,param1.altKey,param1.shiftKey,param1.buttonDown,param1.delta);
  1482.             }
  1483.             param1.target.dispatchEvent(_loc2_);
  1484.          }
  1485.       }
  1486.       
  1487.       private function extraFrameHandler(param1:Event = null) : void
  1488.       {
  1489.          var _loc3_:Class = null;
  1490.          var _loc2_:Object = this.info()["frames"];
  1491.          if(Boolean(_loc2_) && Boolean(_loc2_[currentLabel]))
  1492.          {
  1493.             _loc3_ = Class(this.getDefinitionByName(_loc2_[currentLabel]));
  1494.             _loc3_["frame"](this);
  1495.          }
  1496.          this.deferredNextFrame();
  1497.       }
  1498.       
  1499.       private function nextFrameTimerHandler(param1:TimerEvent) : void
  1500.       {
  1501.          if(currentFrame + 1 <= framesLoaded)
  1502.          {
  1503.             nextFrame();
  1504.             this.nextFrameTimer.removeEventListener(TimerEvent.TIMER,this.nextFrameTimerHandler);
  1505.             this.nextFrameTimer.reset();
  1506.          }
  1507.       }
  1508.       
  1509.       private function initializeTopLevelWindow(param1:Event) : void
  1510.       {
  1511.          var _loc2_:Number = NaN;
  1512.          var _loc3_:Number = NaN;
  1513.          var _loc4_:DisplayObjectContainer = null;
  1514.          var _loc5_:ISystemManager = null;
  1515.          var _loc6_:DisplayObject = null;
  1516.          if(this.getSandboxRoot() == this)
  1517.          {
  1518.             this.addEventListener(KeyboardEvent.KEY_DOWN,this.keyDownHandler,true,1000);
  1519.             this.addEventListener(MouseEvent.MOUSE_WHEEL,this.mouseEventHandler,true,1000);
  1520.             this.addEventListener(MouseEvent.MOUSE_DOWN,this.mouseEventHandler,true,1000);
  1521.          }
  1522.          if(this.isTopLevelRoot() && Boolean(this.stage))
  1523.          {
  1524.             this.stage.addEventListener(KeyboardEvent.KEY_DOWN,this.keyDownHandler,false,1000);
  1525.             this.stage.addEventListener(MouseEvent.MOUSE_WHEEL,this.mouseEventHandler,false,1000);
  1526.             this.stage.addEventListener(MouseEvent.MOUSE_DOWN,this.mouseEventHandler,false,1000);
  1527.          }
  1528.          if(!this.parent && this.parentAllowsChild)
  1529.          {
  1530.             return;
  1531.          }
  1532.          if(!this.mx_internal::topLevel)
  1533.          {
  1534.             if(!this.parent)
  1535.             {
  1536.                return;
  1537.             }
  1538.             _loc4_ = this.parent.parent;
  1539.             if(!_loc4_)
  1540.             {
  1541.                return;
  1542.             }
  1543.             while(_loc4_)
  1544.             {
  1545.                if(_loc4_ is IUIComponent)
  1546.                {
  1547.                   _loc5_ = IUIComponent(_loc4_).systemManager;
  1548.                   if((Boolean(_loc5_)) && !_loc5_.isTopLevel())
  1549.                   {
  1550.                      _loc5_ = _loc5_.topLevelSystemManager;
  1551.                   }
  1552.                   this._topLevelSystemManager = _loc5_;
  1553.                   break;
  1554.                }
  1555.                _loc4_ = _loc4_.parent;
  1556.             }
  1557.          }
  1558.          if(this.isTopLevelRoot() && Boolean(this.stage))
  1559.          {
  1560.             this.stage.addEventListener(Event.RESIZE,this.Stage_resizeHandler,false,0,true);
  1561.          }
  1562.          else if(this.mx_internal::topLevel && Boolean(this.stage))
  1563.          {
  1564.             _loc6_ = this.getSandboxRoot();
  1565.             if(_loc6_ != this)
  1566.             {
  1567.                _loc6_.addEventListener(Event.RESIZE,this.Stage_resizeHandler,false,0,true);
  1568.             }
  1569.          }
  1570.          if(this.mx_internal::isStageRoot && Boolean(this.stage))
  1571.          {
  1572.             this.Stage_resizeHandler();
  1573.             if(this._width == 0 && this._height == 0 && loaderInfo.width != this._width && loaderInfo.height != this._height)
  1574.             {
  1575.                this._width = loaderInfo.width;
  1576.                this._height = loaderInfo.height;
  1577.             }
  1578.             _loc2_ = this._width;
  1579.             _loc3_ = this._height;
  1580.          }
  1581.          else
  1582.          {
  1583.             _loc2_ = loaderInfo.width;
  1584.             _loc3_ = loaderInfo.height;
  1585.          }
  1586.          this.mx_internal::childManager.initializeTopLevelWindow(_loc2_,_loc3_);
  1587.       }
  1588.       
  1589.       private function appCreationCompleteHandler(param1:FlexEvent) : void
  1590.       {
  1591.          this.invalidateParentSizeAndDisplayList();
  1592.       }
  1593.       
  1594.       public function invalidateParentSizeAndDisplayList() : void
  1595.       {
  1596.          var _loc1_:DisplayObjectContainer = null;
  1597.          if(!this.mx_internal::topLevel && Boolean(this.parent))
  1598.          {
  1599.             _loc1_ = this.parent.parent;
  1600.             while(_loc1_)
  1601.             {
  1602.                if(_loc1_ is IInvalidating)
  1603.                {
  1604.                   IInvalidating(_loc1_).invalidateSize();
  1605.                   IInvalidating(_loc1_).invalidateDisplayList();
  1606.                   return;
  1607.                }
  1608.                _loc1_ = _loc1_.parent;
  1609.             }
  1610.          }
  1611.          dispatchEvent(new Event("invalidateParentSizeAndDisplayList"));
  1612.       }
  1613.       
  1614.       private function Stage_resizeHandler(param1:Event = null) : void
  1615.       {
  1616.          var w:Number;
  1617.          var h:Number;
  1618.          var align:String;
  1619.          var x:Number;
  1620.          var y:Number;
  1621.          var m:Number = NaN;
  1622.          var n:Number = NaN;
  1623.          var scale:Number = NaN;
  1624.          var event:Event = param1;
  1625.          if(this.isDispatchingResizeEvent)
  1626.          {
  1627.             return;
  1628.          }
  1629.          w = 0;
  1630.          h = 0;
  1631.          try
  1632.          {
  1633.             m = loaderInfo.width;
  1634.             n = loaderInfo.height;
  1635.          }
  1636.          catch(error:Error)
  1637.          {
  1638.             if(!mx_internal::_screen)
  1639.             {
  1640.                mx_internal::_screen = new Rectangle();
  1641.             }
  1642.             return;
  1643.          }
  1644.          align = StageAlign.TOP_LEFT;
  1645.          try
  1646.          {
  1647.             if(this.stage)
  1648.             {
  1649.                w = this.stage.stageWidth;
  1650.                h = this.stage.stageHeight;
  1651.                align = this.stage.align;
  1652.             }
  1653.          }
  1654.          catch(error:SecurityError)
  1655.          {
  1656.             if(hasEventListener("getScreen"))
  1657.             {
  1658.                dispatchEvent(new Event("getScreen"));
  1659.                if(mx_internal::_screen)
  1660.                {
  1661.                   w = mx_internal::_screen.width;
  1662.                   h = mx_internal::_screen.height;
  1663.                }
  1664.             }
  1665.          }
  1666.          x = (m - w) / 2;
  1667.          y = (n - h) / 2;
  1668.          if(align == StageAlign.TOP)
  1669.          {
  1670.             y = 0;
  1671.          }
  1672.          else if(align == StageAlign.BOTTOM)
  1673.          {
  1674.             y = n - h;
  1675.          }
  1676.          else if(align == StageAlign.LEFT)
  1677.          {
  1678.             x = 0;
  1679.          }
  1680.          else if(align == StageAlign.RIGHT)
  1681.          {
  1682.             x = m - w;
  1683.          }
  1684.          else if(align == StageAlign.TOP_LEFT || align == "LT")
  1685.          {
  1686.             y = 0;
  1687.             x = 0;
  1688.          }
  1689.          else if(align == StageAlign.TOP_RIGHT)
  1690.          {
  1691.             y = 0;
  1692.             x = m - w;
  1693.          }
  1694.          else if(align == StageAlign.BOTTOM_LEFT)
  1695.          {
  1696.             y = n - h;
  1697.             x = 0;
  1698.          }
  1699.          else if(align == StageAlign.BOTTOM_RIGHT)
  1700.          {
  1701.             y = n - h;
  1702.             x = m - w;
  1703.          }
  1704.          if(!this.mx_internal::_screen)
  1705.          {
  1706.             this.mx_internal::_screen = new Rectangle();
  1707.          }
  1708.          this.mx_internal::_screen.x = x;
  1709.          this.mx_internal::_screen.y = y;
  1710.          this.mx_internal::_screen.width = w;
  1711.          this.mx_internal::_screen.height = h;
  1712.          if(this.mx_internal::isStageRoot)
  1713.          {
  1714.             scale = this.mx_internal::densityScale;
  1715.             root.scaleX = root.scaleY = scale;
  1716.             this._width = this.stage.stageWidth / scale;
  1717.             this._height = this.stage.stageHeight / scale;
  1718.             this.mx_internal::_screen.x /= scale;
  1719.             this.mx_internal::_screen.y /= scale;
  1720.             this.mx_internal::_screen.width /= scale;
  1721.             this.mx_internal::_screen.height /= scale;
  1722.          }
  1723.          if(event)
  1724.          {
  1725.             this.resizeMouseCatcher();
  1726.             this.isDispatchingResizeEvent = true;
  1727.             dispatchEvent(event);
  1728.             this.isDispatchingResizeEvent = false;
  1729.          }
  1730.       }
  1731.       
  1732.       private function mouseMoveHandler(param1:MouseEvent) : void
  1733.       {
  1734.          this.mx_internal::idleCounter = 0;
  1735.       }
  1736.       
  1737.       private function mouseUpHandler(param1:MouseEvent) : void
  1738.       {
  1739.          this.mx_internal::idleCounter = 0;
  1740.       }
  1741.       
  1742.       private function idleTimer_timerHandler(param1:TimerEvent) : void
  1743.       {
  1744.          ++this.mx_internal::idleCounter;
  1745.          if(this.mx_internal::idleCounter * IDLE_INTERVAL > IDLE_THRESHOLD)
  1746.          {
  1747.             dispatchEvent(new FlexEvent(FlexEvent.IDLE));
  1748.          }
  1749.       }
  1750.       
  1751.       override public function get mouseX() : Number
  1752.       {
  1753.          if(this.mx_internal::_mouseX === undefined)
  1754.          {
  1755.             return super.mouseX;
  1756.          }
  1757.          return this.mx_internal::_mouseX;
  1758.       }
  1759.       
  1760.       override public function get mouseY() : Number
  1761.       {
  1762.          if(this.mx_internal::_mouseY === undefined)
  1763.          {
  1764.             return super.mouseY;
  1765.          }
  1766.          return this.mx_internal::_mouseY;
  1767.       }
  1768.       
  1769.       private function getTopLevelSystemManager(param1:DisplayObject) : ISystemManager
  1770.       {
  1771.          var _loc3_:ISystemManager = null;
  1772.          var _loc2_:DisplayObjectContainer = DisplayObjectContainer(param1.root);
  1773.          if((!_loc2_ || _loc2_ is Stage) && param1 is IUIComponent)
  1774.          {
  1775.             _loc2_ = DisplayObjectContainer(IUIComponent(param1).systemManager);
  1776.          }
  1777.          if(_loc2_ is ISystemManager)
  1778.          {
  1779.             _loc3_ = ISystemManager(_loc2_);
  1780.             if(!_loc3_.isTopLevel())
  1781.             {
  1782.                _loc3_ = _loc3_.topLevelSystemManager;
  1783.             }
  1784.          }
  1785.          return _loc3_;
  1786.       }
  1787.       
  1788.       override public function get parent() : DisplayObjectContainer
  1789.       {
  1790.          try
  1791.          {
  1792.             return super.parent;
  1793.          }
  1794.          catch(e:SecurityError)
  1795.          {
  1796.          }
  1797.          return null;
  1798.       }
  1799.       
  1800.       public function getTopLevelRoot() : DisplayObject
  1801.       {
  1802.          var _loc1_:ISystemManager = null;
  1803.          var _loc2_:DisplayObject = null;
  1804.          var _loc3_:DisplayObject = null;
  1805.          try
  1806.          {
  1807.             _loc1_ = this;
  1808.             if(_loc1_.topLevelSystemManager)
  1809.             {
  1810.                _loc1_ = _loc1_.topLevelSystemManager;
  1811.             }
  1812.             _loc2_ = DisplayObject(_loc1_).parent;
  1813.             _loc3_ = DisplayObject(_loc1_);
  1814.             while(_loc2_)
  1815.             {
  1816.                if(_loc2_ is Stage)
  1817.                {
  1818.                   return _loc3_;
  1819.                }
  1820.                _loc3_ = _loc2_;
  1821.                _loc2_ = _loc2_.parent;
  1822.             }
  1823.          }
  1824.          catch(error:SecurityError)
  1825.          {
  1826.          }
  1827.          return null;
  1828.       }
  1829.       
  1830.       public function getSandboxRoot() : DisplayObject
  1831.       {
  1832.          var _loc2_:DisplayObject = null;
  1833.          var _loc3_:DisplayObject = null;
  1834.          var _loc4_:Loader = null;
  1835.          var _loc5_:LoaderInfo = null;
  1836.          var _loc1_:ISystemManager = this;
  1837.          try
  1838.          {
  1839.             if(_loc1_.topLevelSystemManager)
  1840.             {
  1841.                _loc1_ = _loc1_.topLevelSystemManager;
  1842.             }
  1843.             _loc2_ = DisplayObject(_loc1_).parent;
  1844.             if(_loc2_ is Stage)
  1845.             {
  1846.                return DisplayObject(_loc1_);
  1847.             }
  1848.             if(Boolean(_loc2_) && !_loc2_.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot",false,true)))
  1849.             {
  1850.                return this;
  1851.             }
  1852.             _loc3_ = this;
  1853.             while(_loc2_)
  1854.             {
  1855.                if(_loc2_ is Stage)
  1856.                {
  1857.                   return _loc3_;
  1858.                }
  1859.                if(!_loc2_.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot",false,true)))
  1860.                {
  1861.                   return _loc3_;
  1862.                }
  1863.                if(_loc2_ is Loader)
  1864.                {
  1865.                   _loc4_ = Loader(_loc2_);
  1866.                   _loc5_ = _loc4_.contentLoaderInfo;
  1867.                   if(!_loc5_.childAllowsParent)
  1868.                   {
  1869.                      return _loc5_.content;
  1870.                   }
  1871.                }
  1872.                if(_loc2_.hasEventListener("systemManagerRequest"))
  1873.                {
  1874.                   _loc3_ = _loc2_;
  1875.                }
  1876.                _loc2_ = _loc2_.parent;
  1877.             }
  1878.          }
  1879.          catch(error:Error)
  1880.          {
  1881.          }
  1882.          return _loc3_ != null ? _loc3_ : DisplayObject(_loc1_);
  1883.       }
  1884.       
  1885.       public function registerImplementation(param1:String, param2:Object) : void
  1886.       {
  1887.          var _loc3_:Object = this.implMap[param1];
  1888.          if(!_loc3_)
  1889.          {
  1890.             this.implMap[param1] = param2;
  1891.          }
  1892.       }
  1893.       
  1894.       public function getImplementation(param1:String) : Object
  1895.       {
  1896.          return this.implMap[param1];
  1897.       }
  1898.       
  1899.       public function getVisibleApplicationRect(param1:Rectangle = null, param2:Boolean = false) : Rectangle
  1900.       {
  1901.          var _loc3_:Request = null;
  1902.          var _loc4_:DisplayObject = null;
  1903.          var _loc5_:Rectangle = null;
  1904.          var _loc6_:Point = null;
  1905.          var _loc7_:DisplayObjectContainer = null;
  1906.          var _loc8_:Rectangle = null;
  1907.          if(hasEventListener("getVisibleApplicationRect"))
  1908.          {
  1909.             _loc3_ = new Request("getVisibleApplicationRect",false,true);
  1910.             _loc3_.value = {
  1911.                "bounds":param1,
  1912.                "skipToSandboxRoot":param2
  1913.             };
  1914.             if(!dispatchEvent(_loc3_))
  1915.             {
  1916.                return Rectangle(_loc3_.value);
  1917.             }
  1918.          }
  1919.          if(param2 && !this.mx_internal::topLevel)
  1920.          {
  1921.             return this.topLevelSystemManager.getVisibleApplicationRect(param1,param2);
  1922.          }
  1923.          if(!param1)
  1924.          {
  1925.             param1 = getBounds(DisplayObject(this));
  1926.             _loc4_ = this.getSandboxRoot();
  1927.             _loc5_ = this.screen.clone();
  1928.             _loc5_.topLeft = _loc4_.localToGlobal(this.screen.topLeft);
  1929.             _loc5_.bottomRight = _loc4_.localToGlobal(this.screen.bottomRight);
  1930.             _loc6_ = new Point(Math.max(0,param1.x),Math.max(0,param1.y));
  1931.             _loc6_ = localToGlobal(_loc6_);
  1932.             param1.x = _loc6_.x;
  1933.             param1.y = _loc6_.y;
  1934.             param1.width = _loc5_.width;
  1935.             param1.height = _loc5_.height;
  1936.          }
  1937.          if(!this.mx_internal::topLevel)
  1938.          {
  1939.             _loc7_ = this.parent.parent;
  1940.             if("getVisibleApplicationRect" in _loc7_)
  1941.             {
  1942.                _loc8_ = _loc7_["getVisibleApplicationRect"](true);
  1943.                param1 = param1.intersection(_loc8_);
  1944.             }
  1945.          }
  1946.          return param1;
  1947.       }
  1948.       
  1949.       public function deployMouseShields(param1:Boolean) : void
  1950.       {
  1951.          var _loc2_:DynamicEvent = null;
  1952.          if(hasEventListener("deployMouseShields"))
  1953.          {
  1954.             _loc2_ = new DynamicEvent("deployMouseShields");
  1955.             _loc2_.deploy = param1;
  1956.             dispatchEvent(_loc2_);
  1957.          }
  1958.       }
  1959.       
  1960.       private function stageEventHandler(param1:Event) : void
  1961.       {
  1962.          var _loc2_:MouseEvent = null;
  1963.          var _loc3_:Point = null;
  1964.          var _loc4_:Point = null;
  1965.          if(param1.target is Stage && Boolean(this.mouseCatcher))
  1966.          {
  1967.             if(param1 is MouseEvent)
  1968.             {
  1969.                _loc2_ = MouseEvent(param1);
  1970.                _loc3_ = new Point(_loc2_.stageX,_loc2_.stageY);
  1971.                _loc4_ = this.mouseCatcher.globalToLocal(_loc3_);
  1972.                _loc2_.localX = _loc4_.x;
  1973.                _loc2_.localY = _loc4_.y;
  1974.             }
  1975.             this.mouseCatcher.dispatchEvent(param1);
  1976.          }
  1977.       }
  1978.       
  1979.       private function mouseLeaveHandler(param1:Event) : void
  1980.       {
  1981.          dispatchEvent(new SandboxMouseEvent(SandboxMouseEvent.MOUSE_UP_SOMEWHERE));
  1982.       }
  1983.    }
  1984. }
  1985.  
  1986.