重新启动Flash应用程序,但不总是工作

重新启动Flash应用程序,但不总是工作,flash,flash-builder,Flash,Flash Builder,我有一个Main.mxml,它有: <components:ScreenSaver id="ScreenSaver" /> p_重启是: public function p_Reboot( e:Event = null):void { var mgr:ProductManager = new ProductManager("airappinstaller

我有一个Main.mxml,它有:

  <components:ScreenSaver id="ScreenSaver" />   
p_重启是:

    public function p_Reboot( e:Event = null):void
    {                                       
             var mgr:ProductManager = new ProductManager("airappinstaller");                mgr.launch("-launch "+ topApplication.nativeApplication.applicationID + " " + topApplication.nativeApplication.publisherID);
             topApplication.nativeApplication.exit();
    }   

Then, in ScreenSaver at the critical moment, I do this:
    dispatchEvent(new Event(AppConstants.REBOOT, true));
一切似乎都很正常,侦听器工作正常,它进入了
p_Reboot
功能,应用程序退出,但从未启动备份

但是,如果我在main.mxml中通过单击按钮调用
p_Reboot
,它就会工作。问题是我的分派事件是在ScreenSaver.mxml中完成的,它位于不同的应用程序域中?所以它找不到要重新启动的应用程序

任何帮助都将不胜感激

    public function p_Reboot( e:Event = null):void
    {                                       
             var mgr:ProductManager = new ProductManager("airappinstaller");                mgr.launch("-launch "+ topApplication.nativeApplication.applicationID + " " + topApplication.nativeApplication.publisherID);
             topApplication.nativeApplication.exit();
    }   

Then, in ScreenSaver at the critical moment, I do this:
    dispatchEvent(new Event(AppConstants.REBOOT, true));