You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2022/08/29 06:11:19 UTC

[royale-asjs] 01/03: Emulation - Naive implementation of getChildByName, I have not considered containers

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

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

commit c2fdcbfee32e66ca5b76543bc5450c72de5ca9f8
Author: Yishay Weiss <yi...@mcafee.com>
AuthorDate: Sun Aug 28 23:09:32 2022 -0700

    Emulation - Naive implementation of getChildByName, I have not considered containers
---
 .../projects/MXRoyale/src/main/royale/mx/core/UIComponent.as     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index ee1884f5e8..d2631e4d79 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -4080,7 +4080,14 @@ COMPILE::JS
     { override }
     public function getChildByName(name:String):IUIComponent
     {
-        trace("getChildByName not implemented");
+        for (var i:int = 0; i < numChildren; i++)
+        {
+            var child:IUIComponent = getChildAt(i);
+            if (child.name == name)
+            {
+                return child;
+            }
+        }
         return null;
     }