      *  @playerversion Flash 9
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
+     */
+    override public function get isProxy():Boolean
+    {
+        return true;
+    }
+
+    //----------------------------------
+    //  screen
+    //----------------------------------
+    /**
+     *  @inheritDoc
      */
     override public function get screen():Rectangle
     {

     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */
        public function deactivateByProxy(f:IFocusManagerContainer):void
        {
                if (f)
            f.focusManager.deactivate();
        }

    //--------------------------------------------------------------------------
    //

        // Tell our parent system manager we are active if our child
        // is a focus container. If our child is not a focus manager
        // container we will not be able to activate pop up in this proxy. 
        if (mp.findFocusManagerContainer(this))
            mp.dispatchActivatedWindowEvent(this);
    }


}

}


import flash.display.DisplayObject;
import flash.events.IEventDispatcher;
import mx.core.ISWFBridgeProvider;
import mx.events.SWFBridgeEvent;
import mx.managers.IActiveWindowManager;
import mx.managers.IFocusManagerContainer;
import mx.managers.IMarshalSystemManager;
import mx.managers.ISystemManager;
import mx.utils.NameUtil;
import mx.utils.SecurityUtil;

class SystemManagerProxyActivePopUpManager implements IActiveWindowManager
{

	private var systemManager:ISystemManager;

	public function SystemManagerProxyActivePopUpManager(systemManager:ISystemManager)
	{
		this.systemManager = systemManager;
	}

    /**
     *  @inheritDoc
     */
    public function activate(f:Object):void
    {
        // trace("SM Proxy: activate " + f );
        
        // Activate the proxied SystemManager.
		var mp:IMarshalSystemManager = 
			IMarshalSystemManager(systemManager.getImplementation("mx.managers::IMarshalSystemManager"));

        var bridge:IEventDispatcher =
	        mp.swfBridgeGroup ? mp.swfBridgeGroup.parentBridge : null;

        if (bridge)
        {
            var mutualTrust:Boolean =
		        SecurityUtil.hasMutualTrustBetweenParentAndChild(ISWFBridgeProvider(systemManager));

            var bridgeEvent:SWFBridgeEvent = new SWFBridgeEvent(
		        SWFBridgeEvent.BRIDGE_WINDOW_ACTIVATE,
				false, false,
				{ notifier: bridge,
					window: mutualTrust ? systemManager : NameUtil.displayObjectToString(DisplayObject(systemManager))
				});
                    
			systemManager.getSandboxRoot().dispatchEvent(bridgeEvent);
        }
    }

	/**
	 *  @inheritDoc
	 */
    public function deactivate(f:Object):void
    {
        // trace("SM Proxy: deactivate " + f );

	    // Deactivate the proxied SystemManager.

		var mp:IMarshalSystemManager = 
			IMarshalSystemManager (systemManager.getImplementation("mx.managers::IMarshalSystemManager"));
            
		var bridge:IEventDispatcher =
			mp.swfBridgeGroup ? mp.swfBridgeGroup.parentBridge : null;
            
	    if (bridge)
        {
            var mutualTrust:Boolean =
		        SecurityUtil.hasMutualTrustBetweenParentAndChild(ISWFBridgeProvider(systemManager));
                    
			var bridgeEvent:SWFBridgeEvent = new SWFBridgeEvent(
				SWFBridgeEvent.BRIDGE_WINDOW_DEACTIVATE,
                false, false,
				{ notifier: bridge,
				    window: mutualTrust ? systemManager : NameUtil.displayObjectToString(DisplayObject(systemManager))
				});

             systemManager.getSandboxRoot().dispatchEvent(bridgeEvent);
         }
    }

	public function get numModalWindows():int
	{
		return systemManager.numModalWindows;
	}

	/**
	 *  @private
	 */
	public function set numModalWindows(value:int):void
	{
        systemManager.numModalWindows = value;
	}

	/**
	 *  @inheritDoc
	 */
	public function addFocusManager(f:IFocusManagerContainer):void
	{
	}

	/**
	 *  @inheritDoc
	 */
	public function removeFocusManager(f:IFocusManagerContainer):void
	{
    }

}
