home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Darbas / kidoz_v1.air / kidoz.swf / scripts / mx / managers / CursorManagerImpl.as < prev    next >
Encoding:
Text File  |  2009-05-06  |  24.7 KB  |  717 lines

  1. package mx.managers
  2. {
  3.    import flash.display.DisplayObject;
  4.    import flash.display.DisplayObjectContainer;
  5.    import flash.display.InteractiveObject;
  6.    import flash.display.Sprite;
  7.    import flash.events.ContextMenuEvent;
  8.    import flash.events.Event;
  9.    import flash.events.EventDispatcher;
  10.    import flash.events.IEventDispatcher;
  11.    import flash.events.IOErrorEvent;
  12.    import flash.events.MouseEvent;
  13.    import flash.events.ProgressEvent;
  14.    import flash.geom.Point;
  15.    import flash.text.TextField;
  16.    import flash.text.TextFieldType;
  17.    import flash.ui.Mouse;
  18.    import mx.core.ApplicationGlobals;
  19.    import mx.core.EventPriority;
  20.    import mx.core.FlexSprite;
  21.    import mx.core.mx_internal;
  22.    import mx.events.InterManagerRequest;
  23.    import mx.events.SWFBridgeRequest;
  24.    import mx.events.SandboxMouseEvent;
  25.    import mx.styles.CSSStyleDeclaration;
  26.    import mx.styles.StyleManager;
  27.    
  28.    use namespace mx_internal;
  29.    
  30.    public class CursorManagerImpl implements ICursorManager
  31.    {
  32.       private static var instance:ICursorManager;
  33.       
  34.       mx_internal static const VERSION:String = "3.2.0.3958";
  35.       
  36.       private var showSystemCursor:Boolean = false;
  37.       
  38.       private var nextCursorID:int = 1;
  39.       
  40.       private var systemManager:ISystemManager = null;
  41.       
  42.       private var cursorList:Array = [];
  43.       
  44.       private var _currentCursorYOffset:Number = 0;
  45.       
  46.       private var cursorHolder:Sprite;
  47.       
  48.       private var currentCursor:DisplayObject;
  49.       
  50.       private var sandboxRoot:IEventDispatcher = null;
  51.       
  52.       private var showCustomCursor:Boolean = false;
  53.       
  54.       private var listenForContextMenu:Boolean = false;
  55.       
  56.       private var _currentCursorID:int = 0;
  57.       
  58.       private var initialized:Boolean = false;
  59.       
  60.       private var overTextField:Boolean = false;
  61.       
  62.       private var _currentCursorXOffset:Number = 0;
  63.       
  64.       private var busyCursorList:Array = [];
  65.       
  66.       private var overLink:Boolean = false;
  67.       
  68.       private var sourceArray:Array = [];
  69.       
  70.       public function CursorManagerImpl(param1:ISystemManager = null)
  71.       {
  72.          super();
  73.          if(Boolean(instance) && !param1)
  74.          {
  75.             throw new Error("Instance already exists.");
  76.          }
  77.          if(param1)
  78.          {
  79.             this.systemManager = param1 as ISystemManager;
  80.          }
  81.          else
  82.          {
  83.             this.systemManager = SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager;
  84.          }
  85.          sandboxRoot = this.systemManager.getSandboxRoot();
  86.          sandboxRoot.addEventListener(InterManagerRequest.CURSOR_MANAGER_REQUEST,marshalCursorManagerHandler,false,0,true);
  87.          var _loc2_:InterManagerRequest = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  88.          _loc2_.name = "update";
  89.          sandboxRoot.dispatchEvent(_loc2_);
  90.       }
  91.       
  92.       public static function getInstance() : ICursorManager
  93.       {
  94.          if(!instance)
  95.          {
  96.             instance = new CursorManagerImpl();
  97.          }
  98.          return instance;
  99.       }
  100.       
  101.       public function set currentCursorYOffset(param1:Number) : void
  102.       {
  103.          var _loc2_:InterManagerRequest = null;
  104.          _currentCursorYOffset = param1;
  105.          if(!cursorHolder)
  106.          {
  107.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  108.             _loc2_.name = "currentCursorYOffset";
  109.             _loc2_.value = currentCursorYOffset;
  110.             sandboxRoot.dispatchEvent(_loc2_);
  111.          }
  112.       }
  113.       
  114.       public function get currentCursorXOffset() : Number
  115.       {
  116.          return _currentCursorXOffset;
  117.       }
  118.       
  119.       public function removeCursor(param1:int) : void
  120.       {
  121.          var _loc2_:Object = null;
  122.          var _loc3_:InterManagerRequest = null;
  123.          var _loc4_:CursorQueueItem = null;
  124.          if(initialized && !cursorHolder)
  125.          {
  126.             _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  127.             _loc3_.name = "removeCursor";
  128.             _loc3_.value = param1;
  129.             sandboxRoot.dispatchEvent(_loc3_);
  130.             return;
  131.          }
  132.          for(_loc2_ in cursorList)
  133.          {
  134.             _loc4_ = cursorList[_loc2_];
  135.             if(_loc4_.cursorID == param1)
  136.             {
  137.                cursorList.splice(_loc2_,1);
  138.                showCurrentCursor();
  139.                break;
  140.             }
  141.          }
  142.       }
  143.       
  144.       public function get currentCursorID() : int
  145.       {
  146.          return _currentCursorID;
  147.       }
  148.       
  149.       private function marshalMouseMoveHandler(param1:Event) : void
  150.       {
  151.          var _loc2_:SWFBridgeRequest = null;
  152.          var _loc3_:IEventDispatcher = null;
  153.          if(cursorHolder.visible)
  154.          {
  155.             cursorHolder.visible = false;
  156.             _loc2_ = new SWFBridgeRequest(SWFBridgeRequest.SHOW_MOUSE_CURSOR_REQUEST);
  157.             if(systemManager.useSWFBridge())
  158.             {
  159.                _loc3_ = systemManager.swfBridgeGroup.parentBridge;
  160.             }
  161.             else
  162.             {
  163.                _loc3_ = systemManager;
  164.             }
  165.             _loc2_.requestor = _loc3_;
  166.             _loc3_.dispatchEvent(_loc2_);
  167.             if(_loc2_.data)
  168.             {
  169.                Mouse.show();
  170.             }
  171.          }
  172.       }
  173.       
  174.       public function set currentCursorID(param1:int) : void
  175.       {
  176.          var _loc2_:InterManagerRequest = null;
  177.          _currentCursorID = param1;
  178.          if(!cursorHolder)
  179.          {
  180.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  181.             _loc2_.name = "currentCursorID";
  182.             _loc2_.value = currentCursorID;
  183.             sandboxRoot.dispatchEvent(_loc2_);
  184.          }
  185.       }
  186.       
  187.       public function removeAllCursors() : void
  188.       {
  189.          var _loc1_:InterManagerRequest = null;
  190.          if(initialized && !cursorHolder)
  191.          {
  192.             _loc1_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  193.             _loc1_.name = "removeAllCursors";
  194.             sandboxRoot.dispatchEvent(_loc1_);
  195.             return;
  196.          }
  197.          cursorList.splice(0);
  198.          showCurrentCursor();
  199.       }
  200.       
  201.       private function priorityCompare(param1:CursorQueueItem, param2:CursorQueueItem) : int
  202.       {
  203.          if(param1.priority < param2.priority)
  204.          {
  205.             return -1;
  206.          }
  207.          if(param1.priority == param2.priority)
  208.          {
  209.             return 0;
  210.          }
  211.          return 1;
  212.       }
  213.       
  214.       public function setBusyCursor() : void
  215.       {
  216.          var _loc3_:InterManagerRequest = null;
  217.          if(initialized && !cursorHolder)
  218.          {
  219.             _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  220.             _loc3_.name = "setBusyCursor";
  221.             sandboxRoot.dispatchEvent(_loc3_);
  222.             return;
  223.          }
  224.          var _loc1_:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CursorManager");
  225.          var _loc2_:Class = _loc1_.getStyle("busyCursor");
  226.          busyCursorList.push(setCursor(_loc2_,CursorManagerPriority.LOW));
  227.       }
  228.       
  229.       public function showCursor() : void
  230.       {
  231.          var _loc1_:InterManagerRequest = null;
  232.          if(cursorHolder)
  233.          {
  234.             cursorHolder.visible = true;
  235.          }
  236.          else
  237.          {
  238.             _loc1_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  239.             _loc1_.name = "showCursor";
  240.             sandboxRoot.dispatchEvent(_loc1_);
  241.          }
  242.       }
  243.       
  244.       private function findSource(param1:Object) : int
  245.       {
  246.          var _loc2_:int = int(sourceArray.length);
  247.          var _loc3_:int = 0;
  248.          while(_loc3_ < _loc2_)
  249.          {
  250.             if(sourceArray[_loc3_] === param1)
  251.             {
  252.                return _loc3_;
  253.             }
  254.             _loc3_++;
  255.          }
  256.          return -1;
  257.       }
  258.       
  259.       private function showCurrentCursor() : void
  260.       {
  261.          var _loc1_:InteractiveObject = null;
  262.          var _loc2_:InteractiveObject = null;
  263.          var _loc3_:CursorQueueItem = null;
  264.          var _loc4_:InterManagerRequest = null;
  265.          var _loc5_:Point = null;
  266.          if(cursorList.length > 0)
  267.          {
  268.             if(!initialized)
  269.             {
  270.                cursorHolder = new FlexSprite();
  271.                cursorHolder.name = "cursorHolder";
  272.                cursorHolder.mouseEnabled = false;
  273.                cursorHolder.mouseChildren = false;
  274.                systemManager.addChildToSandboxRoot("cursorChildren",cursorHolder);
  275.                initialized = true;
  276.                _loc4_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  277.                _loc4_.name = "initialized";
  278.                sandboxRoot.dispatchEvent(_loc4_);
  279.             }
  280.             _loc3_ = cursorList[0];
  281.             if(currentCursorID == CursorManager.NO_CURSOR)
  282.             {
  283.                Mouse.hide();
  284.             }
  285.             if(_loc3_.cursorID != currentCursorID)
  286.             {
  287.                if(cursorHolder.numChildren > 0)
  288.                {
  289.                   cursorHolder.removeChildAt(0);
  290.                }
  291.                currentCursor = new _loc3_.cursorClass();
  292.                if(currentCursor)
  293.                {
  294.                   if(currentCursor is InteractiveObject)
  295.                   {
  296.                      InteractiveObject(currentCursor).mouseEnabled = false;
  297.                   }
  298.                   if(currentCursor is DisplayObjectContainer)
  299.                   {
  300.                      DisplayObjectContainer(currentCursor).mouseChildren = false;
  301.                   }
  302.                   cursorHolder.addChild(currentCursor);
  303.                   if(!listenForContextMenu)
  304.                   {
  305.                      _loc1_ = systemManager.document as InteractiveObject;
  306.                      if(Boolean(_loc1_) && Boolean(_loc1_.contextMenu))
  307.                      {
  308.                         _loc1_.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,contextMenu_menuSelectHandler);
  309.                         listenForContextMenu = true;
  310.                      }
  311.                      _loc2_ = systemManager as InteractiveObject;
  312.                      if(Boolean(_loc2_) && Boolean(_loc2_.contextMenu))
  313.                      {
  314.                         _loc2_.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT,contextMenu_menuSelectHandler);
  315.                         listenForContextMenu = true;
  316.                      }
  317.                   }
  318.                   if(systemManager is SystemManager)
  319.                   {
  320.                      _loc5_ = new Point(SystemManager(systemManager).mouseX + _loc3_.x,SystemManager(systemManager).mouseY + _loc3_.y);
  321.                      _loc5_ = SystemManager(systemManager).localToGlobal(_loc5_);
  322.                      _loc5_ = cursorHolder.parent.globalToLocal(_loc5_);
  323.                      cursorHolder.x = _loc5_.x;
  324.                      cursorHolder.y = _loc5_.y;
  325.                   }
  326.                   else if(systemManager is DisplayObject)
  327.                   {
  328.                      _loc5_ = new Point(DisplayObject(systemManager).mouseX + _loc3_.x,DisplayObject(systemManager).mouseY + _loc3_.y);
  329.                      _loc5_ = DisplayObject(systemManager).localToGlobal(_loc5_);
  330.                      _loc5_ = cursorHolder.parent.globalToLocal(_loc5_);
  331.                      cursorHolder.x = DisplayObject(systemManager).mouseX + _loc3_.x;
  332.                      cursorHolder.y = DisplayObject(systemManager).mouseY + _loc3_.y;
  333.                   }
  334.                   else
  335.                   {
  336.                      cursorHolder.x = _loc3_.x;
  337.                      cursorHolder.y = _loc3_.y;
  338.                   }
  339.                   if(systemManager.useSWFBridge())
  340.                   {
  341.                      sandboxRoot.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true,EventPriority.CURSOR_MANAGEMENT);
  342.                   }
  343.                   else
  344.                   {
  345.                      systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true,EventPriority.CURSOR_MANAGEMENT);
  346.                   }
  347.                   sandboxRoot.addEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE,marshalMouseMoveHandler,false,EventPriority.CURSOR_MANAGEMENT);
  348.                }
  349.                currentCursorID = _loc3_.cursorID;
  350.                currentCursorXOffset = _loc3_.x;
  351.                currentCursorYOffset = _loc3_.y;
  352.             }
  353.          }
  354.          else
  355.          {
  356.             if(currentCursorID != CursorManager.NO_CURSOR)
  357.             {
  358.                currentCursorID = CursorManager.NO_CURSOR;
  359.                currentCursorXOffset = 0;
  360.                currentCursorYOffset = 0;
  361.                if(systemManager.useSWFBridge())
  362.                {
  363.                   sandboxRoot.removeEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true);
  364.                }
  365.                else
  366.                {
  367.                   systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler,true);
  368.                }
  369.                sandboxRoot.removeEventListener(SandboxMouseEvent.MOUSE_MOVE_SOMEWHERE,marshalMouseMoveHandler,false);
  370.                cursorHolder.removeChild(currentCursor);
  371.                if(listenForContextMenu)
  372.                {
  373.                   _loc1_ = systemManager.document as InteractiveObject;
  374.                   if(Boolean(_loc1_) && Boolean(_loc1_.contextMenu))
  375.                   {
  376.                      _loc1_.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT,contextMenu_menuSelectHandler);
  377.                   }
  378.                   _loc2_ = systemManager as InteractiveObject;
  379.                   if(Boolean(_loc2_) && Boolean(_loc2_.contextMenu))
  380.                   {
  381.                      _loc2_.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT,contextMenu_menuSelectHandler);
  382.                   }
  383.                   listenForContextMenu = false;
  384.                }
  385.             }
  386.             Mouse.show();
  387.          }
  388.       }
  389.       
  390.       public function get currentCursorYOffset() : Number
  391.       {
  392.          return _currentCursorYOffset;
  393.       }
  394.       
  395.       private function contextMenu_menuSelectHandler(param1:ContextMenuEvent) : void
  396.       {
  397.          showCustomCursor = true;
  398.          sandboxRoot.addEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
  399.       }
  400.       
  401.       public function hideCursor() : void
  402.       {
  403.          var _loc1_:InterManagerRequest = null;
  404.          if(cursorHolder)
  405.          {
  406.             cursorHolder.visible = false;
  407.          }
  408.          else
  409.          {
  410.             _loc1_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  411.             _loc1_.name = "hideCursor";
  412.             sandboxRoot.dispatchEvent(_loc1_);
  413.          }
  414.       }
  415.       
  416.       private function marshalCursorManagerHandler(param1:Event) : void
  417.       {
  418.          var _loc3_:InterManagerRequest = null;
  419.          if(param1 is InterManagerRequest)
  420.          {
  421.             return;
  422.          }
  423.          var _loc2_:Object = param1;
  424.          switch(_loc2_.name)
  425.          {
  426.             case "initialized":
  427.                initialized = _loc2_.value;
  428.                break;
  429.             case "currentCursorID":
  430.                _currentCursorID = _loc2_.value;
  431.                break;
  432.             case "currentCursorXOffset":
  433.                _currentCursorXOffset = _loc2_.value;
  434.                break;
  435.             case "currentCursorYOffset":
  436.                _currentCursorYOffset = _loc2_.value;
  437.                break;
  438.             case "showCursor":
  439.                if(cursorHolder)
  440.                {
  441.                   cursorHolder.visible = true;
  442.                }
  443.                break;
  444.             case "hideCursor":
  445.                if(cursorHolder)
  446.                {
  447.                   cursorHolder.visible = false;
  448.                }
  449.                break;
  450.             case "setCursor":
  451.                if(cursorHolder)
  452.                {
  453.                   _loc2_.value = setCursor.apply(this,_loc2_.value);
  454.                }
  455.                break;
  456.             case "removeCursor":
  457.                if(cursorHolder)
  458.                {
  459.                   removeCursor.apply(this,[_loc2_.value]);
  460.                }
  461.                break;
  462.             case "removeAllCursors":
  463.                if(cursorHolder)
  464.                {
  465.                   removeAllCursors();
  466.                }
  467.                break;
  468.             case "setBusyCursor":
  469.                if(cursorHolder)
  470.                {
  471.                   setBusyCursor();
  472.                }
  473.                break;
  474.             case "removeBusyCursor":
  475.                if(cursorHolder)
  476.                {
  477.                   removeBusyCursor();
  478.                }
  479.                break;
  480.             case "registerToUseBusyCursor":
  481.                if(cursorHolder)
  482.                {
  483.                   registerToUseBusyCursor.apply(this,_loc2_.value);
  484.                }
  485.                break;
  486.             case "unRegisterToUseBusyCursor":
  487.                if(cursorHolder)
  488.                {
  489.                   unRegisterToUseBusyCursor.apply(this,_loc2_.value);
  490.                }
  491.                break;
  492.             case "update":
  493.                if(cursorHolder)
  494.                {
  495.                   _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  496.                   _loc3_.name = "initialized";
  497.                   _loc3_.value = true;
  498.                   sandboxRoot.dispatchEvent(_loc3_);
  499.                   _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  500.                   _loc3_.name = "currentCursorID";
  501.                   _loc3_.value = currentCursorID;
  502.                   sandboxRoot.dispatchEvent(_loc3_);
  503.                   _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  504.                   _loc3_.name = "currentCursorXOffset";
  505.                   _loc3_.value = currentCursorXOffset;
  506.                   sandboxRoot.dispatchEvent(_loc3_);
  507.                   _loc3_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  508.                   _loc3_.name = "currentCursorYOffset";
  509.                   _loc3_.value = currentCursorYOffset;
  510.                   sandboxRoot.dispatchEvent(_loc3_);
  511.                }
  512.          }
  513.       }
  514.       
  515.       public function registerToUseBusyCursor(param1:Object) : void
  516.       {
  517.          var _loc2_:InterManagerRequest = null;
  518.          if(initialized && !cursorHolder)
  519.          {
  520.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  521.             _loc2_.name = "registerToUseBusyCursor";
  522.             _loc2_.value = param1;
  523.             sandboxRoot.dispatchEvent(_loc2_);
  524.             return;
  525.          }
  526.          if(Boolean(param1) && param1 is EventDispatcher)
  527.          {
  528.             param1.addEventListener(ProgressEvent.PROGRESS,progressHandler);
  529.             param1.addEventListener(Event.COMPLETE,completeHandler);
  530.             param1.addEventListener(IOErrorEvent.IO_ERROR,completeHandler);
  531.          }
  532.       }
  533.       
  534.       private function completeHandler(param1:Event) : void
  535.       {
  536.          var _loc2_:int = findSource(param1.target);
  537.          if(_loc2_ != -1)
  538.          {
  539.             sourceArray.splice(_loc2_,1);
  540.             removeBusyCursor();
  541.          }
  542.       }
  543.       
  544.       public function removeBusyCursor() : void
  545.       {
  546.          var _loc1_:InterManagerRequest = null;
  547.          if(initialized && !cursorHolder)
  548.          {
  549.             _loc1_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  550.             _loc1_.name = "removeBusyCursor";
  551.             sandboxRoot.dispatchEvent(_loc1_);
  552.             return;
  553.          }
  554.          if(busyCursorList.length > 0)
  555.          {
  556.             removeCursor(int(busyCursorList.pop()));
  557.          }
  558.       }
  559.       
  560.       public function setCursor(param1:Class, param2:int = 2, param3:Number = 0, param4:Number = 0) : int
  561.       {
  562.          var _loc7_:InterManagerRequest = null;
  563.          if(initialized && !cursorHolder)
  564.          {
  565.             _loc7_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  566.             _loc7_.name = "setCursor";
  567.             _loc7_.value = [param1,param2,param3,param4];
  568.             sandboxRoot.dispatchEvent(_loc7_);
  569.             return _loc7_.value as int;
  570.          }
  571.          var _loc5_:int = int(nextCursorID++);
  572.          var _loc6_:CursorQueueItem = new CursorQueueItem();
  573.          _loc6_.cursorID = _loc5_;
  574.          _loc6_.cursorClass = param1;
  575.          _loc6_.priority = param2;
  576.          _loc6_.x = param3;
  577.          _loc6_.y = param4;
  578.          if(systemManager)
  579.          {
  580.             _loc6_.systemManager = systemManager;
  581.          }
  582.          else
  583.          {
  584.             _loc6_.systemManager = ApplicationGlobals.application.systemManager;
  585.          }
  586.          cursorList.push(_loc6_);
  587.          cursorList.sort(priorityCompare);
  588.          showCurrentCursor();
  589.          return _loc5_;
  590.       }
  591.       
  592.       private function progressHandler(param1:ProgressEvent) : void
  593.       {
  594.          var _loc2_:int = findSource(param1.target);
  595.          if(_loc2_ == -1)
  596.          {
  597.             sourceArray.push(param1.target);
  598.             setBusyCursor();
  599.          }
  600.       }
  601.       
  602.       private function mouseMoveHandler(param1:MouseEvent) : void
  603.       {
  604.          var _loc4_:SWFBridgeRequest = null;
  605.          var _loc5_:IEventDispatcher = null;
  606.          var _loc2_:Point = new Point(param1.stageX,param1.stageY);
  607.          _loc2_ = cursorHolder.parent.globalToLocal(_loc2_);
  608.          _loc2_.x += currentCursorXOffset;
  609.          _loc2_.y += currentCursorYOffset;
  610.          cursorHolder.x = _loc2_.x;
  611.          cursorHolder.y = _loc2_.y;
  612.          var _loc3_:Object = param1.target;
  613.          if(!overTextField && _loc3_ is TextField && _loc3_.type == TextFieldType.INPUT)
  614.          {
  615.             overTextField = true;
  616.             showSystemCursor = true;
  617.          }
  618.          else if(overTextField && !(_loc3_ is TextField && _loc3_.type == TextFieldType.INPUT))
  619.          {
  620.             overTextField = false;
  621.             showCustomCursor = true;
  622.          }
  623.          else
  624.          {
  625.             showCustomCursor = true;
  626.          }
  627.          if(showSystemCursor)
  628.          {
  629.             showSystemCursor = false;
  630.             cursorHolder.visible = false;
  631.             Mouse.show();
  632.          }
  633.          if(showCustomCursor)
  634.          {
  635.             showCustomCursor = false;
  636.             cursorHolder.visible = true;
  637.             Mouse.hide();
  638.             _loc4_ = new SWFBridgeRequest(SWFBridgeRequest.HIDE_MOUSE_CURSOR_REQUEST);
  639.             if(systemManager.useSWFBridge())
  640.             {
  641.                _loc5_ = systemManager.swfBridgeGroup.parentBridge;
  642.             }
  643.             else
  644.             {
  645.                _loc5_ = systemManager;
  646.             }
  647.             _loc4_.requestor = _loc5_;
  648.             _loc5_.dispatchEvent(_loc4_);
  649.          }
  650.       }
  651.       
  652.       public function unRegisterToUseBusyCursor(param1:Object) : void
  653.       {
  654.          var _loc2_:InterManagerRequest = null;
  655.          if(initialized && !cursorHolder)
  656.          {
  657.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  658.             _loc2_.name = "unRegisterToUseBusyCursor";
  659.             _loc2_.value = param1;
  660.             sandboxRoot.dispatchEvent(_loc2_);
  661.             return;
  662.          }
  663.          if(Boolean(param1) && param1 is EventDispatcher)
  664.          {
  665.             param1.removeEventListener(ProgressEvent.PROGRESS,progressHandler);
  666.             param1.removeEventListener(Event.COMPLETE,completeHandler);
  667.             param1.removeEventListener(IOErrorEvent.IO_ERROR,completeHandler);
  668.          }
  669.       }
  670.       
  671.       private function mouseOverHandler(param1:MouseEvent) : void
  672.       {
  673.          sandboxRoot.removeEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
  674.          mouseMoveHandler(param1);
  675.       }
  676.       
  677.       public function set currentCursorXOffset(param1:Number) : void
  678.       {
  679.          var _loc2_:InterManagerRequest = null;
  680.          _currentCursorXOffset = param1;
  681.          if(!cursorHolder)
  682.          {
  683.             _loc2_ = new InterManagerRequest(InterManagerRequest.CURSOR_MANAGER_REQUEST);
  684.             _loc2_.name = "currentCursorXOffset";
  685.             _loc2_.value = currentCursorXOffset;
  686.             sandboxRoot.dispatchEvent(_loc2_);
  687.          }
  688.       }
  689.    }
  690. }
  691.  
  692. import mx.core.mx_internal;
  693.  
  694. use namespace mx_internal;
  695.  
  696. class CursorQueueItem
  697. {
  698.    mx_internal static const VERSION:String = "3.2.0.3958";
  699.    
  700.    public var priority:int = 2;
  701.    
  702.    public var cursorClass:Class = null;
  703.    
  704.    public var cursorID:int = 0;
  705.    
  706.    public var x:Number;
  707.    
  708.    public var y:Number;
  709.    
  710.    public var systemManager:ISystemManager;
  711.    
  712.    public function CursorQueueItem()
  713.    {
  714.       super();
  715.    }
  716. }
  717.