royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-asjs] branch develop updated: try moving initialView to be last property to set up so fx:Declarations and most other properties get initialized first. This should be more like the order of execution in Flex
Date Thu, 03 May 2018 19:31:14 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
     new 40d0e1c  try moving initialView to be last property to set up so fx:Declarations
and most other properties get initialized first.  This should be more like the order of execution
in Flex
40d0e1c is described below

commit 40d0e1ca8ca44cc5272e9c69c86d4cf009f6c1a7
Author: Alex Harui <aharui@apache.org>
AuthorDate: Thu May 3 12:31:01 2018 -0700

    try moving initialView to be last property to set up so fx:Declarations and most other
properties get initialized first.  This should be more like the order of execution in Flex
---
 .../main/royale/org/apache/royale/core/Application.as   | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
index 44f20be..d50d6e7 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
@@ -23,7 +23,7 @@ package org.apache.royale.core
     import org.apache.royale.events.IEventDispatcher;
     import org.apache.royale.events.MouseEvent;
     import org.apache.royale.utils.MXMLDataInterpreter;
-	import org.apache.royale.utils.Timer;
+    import org.apache.royale.utils.Timer;
 
     COMPILE::SWF {
         import flash.display.DisplayObject;
@@ -372,6 +372,21 @@ package org.apache.royale.core
          */
     	public function generateMXMLAttributes(data:Array):void
         {
+            // move the initialView to be the last thing to be
+            // the last thing instantiated so all other properties
+            // are set up first.  This more closely mimics the
+            // Flex timing
+            var propCount:int = data[0];
+            var n:int = data.length;
+            for (var i:int = 1; i < n; i += 3)
+            {
+                if (data[i] == "initialView")
+                {
+                    var initialViewArray:Array = data.splice(i, 3);
+                    var offset:int = (propCount - 1) * 3 + 1;
+                    data.splice(offset, 0, initialViewArray[0], initialViewArray[1], initialViewArray[2]);
+                }
+            }
 			MXMLDataInterpreter.generateMXMLProperties(this, data);
         }
 

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.

Mime
View raw message