This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit d45d47636fec97c2da79309a74ba7e0bef86b8af
Author: greg-dove <[email protected]>
AuthorDate: Wed Apr 15 20:05:09 2020 +1200

    Fix for #805.
    I am not sure why the original code inside mx.core.Application is like it 
is, so leaving it mainly as is, but avoiding multi-dispatch of 'preinitialize'
---
 .../MXRoyale/src/main/royale/mx/core/Application.as         | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
index 69f1194..9f669f9 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
@@ -64,6 +64,7 @@ import mx.events.utils.KeyboardEventConverter;
 import mx.events.utils.MouseEventConverter;
 import mx.managers.FocusManager;
 import mx.managers.ISystemManager;
+import mx.events.FlexEvent;
 
 COMPILE::JS {
     import org.apache.royale.core.ElementWrapper;
@@ -371,7 +372,7 @@ public class Application extends Container implements 
IStrand, IParent, IEventDi
                FocusEventConverter.setupAllConverters(stage);
                KeyboardEventConverter.setupAllConverters(stage);
                
-               if (dispatchEvent(new 
org.apache.royale.events.Event("preinitialize", false, true)))
+               if (initialized || dispatchEvent(new 
org.apache.royale.events.Event("preinitialize", false, true)))
                        this.initializeApplication();
                else
                        addEventListener(flash.events.Event.ENTER_FRAME, 
enterFrameHandler);
@@ -381,7 +382,7 @@ public class Application extends Container implements 
IStrand, IParent, IEventDi
        COMPILE::SWF
        private function enterFrameHandler(event:flash.events.Event):void
        {
-               if (dispatchEvent(new 
org.apache.royale.events.Event("preinitialize", false, true)))
+               if (initialized || dispatchEvent(new 
org.apache.royale.events.Event("preinitialize", false, true)))
                {
                        removeEventListener(flash.events.Event.ENTER_FRAME, 
enterFrameHandler);
                        this.initializeApplication();
@@ -456,7 +457,7 @@ public class Application extends Container implements 
IStrand, IParent, IEventDi
         
                this.initManagers();
 
-        dispatchEvent(new 
org.apache.royale.events.Event("applicationComplete"));
+        dispatchEvent(new FlexEvent("applicationComplete"));
     }
        
        
//--------------------------------------------------------------------------
@@ -606,7 +607,7 @@ public class Application extends Container implements 
IStrand, IParent, IEventDi
        COMPILE::JS
        public function start():void
        {
-               if (dispatchEvent(new 
org.apache.royale.events.Event("preinitialize", false, true)))
+               if (initialized || dispatchEvent(new FlexEvent("preinitialize", 
false, true)))
                        initializeApplication();
                else {                  
                        startupTimer = new Timer(34, 0);
@@ -621,7 +622,7 @@ public class Application extends Container implements 
IStrand, IParent, IEventDi
        COMPILE::JS
        protected function handleStartupTimer(event:Event):void
        {
-               if (dispatchEvent(new 
org.apache.royale.events.Event("preinitialize", false, true)))
+               if (initialized || dispatchEvent(new FlexEvent("preinitialize", 
false, true)))
                {
                        startupTimer.stop();
                        initializeApplication();
@@ -655,7 +656,7 @@ public class Application extends Container implements 
IStrand, IParent, IEventDi
 //                     
 //                     dispatchEvent(new 
org.apache.royale.events.Event("viewChanged"));
 //             }
-               dispatchEvent(new 
org.apache.royale.events.Event("applicationComplete"));
+               dispatchEvent(new FlexEvent("applicationComplete"));
        }
        
     COMPILE::JS

Reply via email to