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

[royale-asjs] 02/10: instead of just , use more decoration so it is clear what you are trying to skip and so there aren't conflicts

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

commit bcf01445a141e4877148177a5f4934694cda8d1f
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Nov 15 11:24:43 2018 -0800

    instead of just , use more decoration so it is clear what you are trying to skip and so there aren't conflicts
---
 .../main/royale/org/apache/royale/core/UIBase.as   | 44 ++++++-------
 .../royale/html/accessories/TextPromptBead.as      |  4 +-
 .../royale/html/beads/BackgroundImageBead.as       |  2 +-
 .../org/apache/royale/html/beads/HScrollBarView.as |  8 +--
 .../org/apache/royale/html/beads/SpinnerView.as    |  4 +-
 .../apache/royale/html/beads/TextFieldViewBase.as  |  2 +-
 .../org/apache/royale/html/beads/VScrollBarView.as |  8 +--
 .../org/apache/royale/html/beads/WebBrowserView.as |  2 +-
 .../MXRoyale/src/main/royale/mx/charts/Legend.as   | 14 ++--
 .../src/main/royale/mx/controls/MenuBar.as         |  2 +-
 .../mx/controls/beads/CSSImageAndTextButtonView.as |  2 +-
 .../main/royale/mx/controls/beads/CheckBoxView.as  |  6 +-
 .../royale/mx/controls/beads/RadioButtonView.as    | 12 ++--
 .../src/main/royale/mx/core/Application.as         |  2 +-
 .../src/main/royale/mx/core/UIComponent.as         | 74 ++++++++++++++--------
 .../spark/components/supportClasses/TextBase.as    |  4 +-
 16 files changed, 105 insertions(+), 85 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
index 457173f..d200589 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
@@ -1249,13 +1249,13 @@ package org.apache.royale.core
                 if (c is IUIBase)
                 {
                     if (c is IRenderedObject)
-                        $addChild(IRenderedObject(c).$displayObject);
+                        $sprite_addChild(IRenderedObject(c).$displayObject);
                     else
-                        $addChild(c as DisplayObject);                        
+                        $sprite_addChild(c as DisplayObject);                        
                     IUIBase(c).addedToParent();
                 }
                 else
-                    $addChild(c as DisplayObject);
+                    $sprite_addChild(c as DisplayObject);
             }
             COMPILE::JS
             {
@@ -1280,13 +1280,13 @@ package org.apache.royale.core
                 if (c is IUIBase)
                 {
                     if (c is IRenderedObject)
-                        $addChildAt(IUIBase(c).$displayObject, index);
+                        $sprite_addChildAt(IUIBase(c).$displayObject, index);
                     else
-                        $addChildAt(c as DisplayObject, index);
+                        $sprite_addChildAt(c as DisplayObject, index);
                     IUIBase(c).addedToParent();
                 }
                 else
-                    $addChildAt(c as DisplayObject, index);
+                    $sprite_addChildAt(c as DisplayObject, index);
             }
             COMPILE::JS
             {
@@ -1314,7 +1314,7 @@ package org.apache.royale.core
         {
             COMPILE::SWF
             {
-                return $getChildAt(index) as IChild;
+                return $sprite_getChildAt(index) as IChild;
             }
             COMPILE::JS
             {
@@ -1340,9 +1340,9 @@ package org.apache.royale.core
             COMPILE::SWF
             {
                 if (c is IRenderedObject)
-                    return $getChildIndex(IRenderedObject(c).$displayObject);
+                    return $sprite_getChildIndex(IRenderedObject(c).$displayObject);
                 else
-                    return $getChildIndex(c as DisplayObject);
+                    return $sprite_getChildIndex(c as DisplayObject);
             }
             COMPILE::JS
             {
@@ -1371,9 +1371,9 @@ package org.apache.royale.core
             COMPILE::SWF
             {
                 if (c is IRenderedObject)
-                    $removeChild(IRenderedObject(c).$displayObject);
+                    $sprite_removeChild(IRenderedObject(c).$displayObject);
                 else
-                    $removeChild(c as DisplayObject);
+                    $sprite_removeChild(c as DisplayObject);
             }
             COMPILE::JS
             {
@@ -1393,7 +1393,7 @@ package org.apache.royale.core
         {
             COMPILE::SWF
             {
-                return $numChildren;
+                return $sprite_numChildren;
             }
             COMPILE::JS
             {
@@ -1640,52 +1640,52 @@ package org.apache.royale.core
         }
         
         COMPILE::SWF
-        public function $addChild(child:DisplayObject):DisplayObject
+        public function $sprite_addChild(child:DisplayObject):DisplayObject
         {
             return super.addChild(child);
         }
         COMPILE::SWF
-        public function $addChildAt(child:DisplayObject, index:int):DisplayObject
+        public function $sprite_addChildAt(child:DisplayObject, index:int):DisplayObject
         {
             return super.addChildAt(child, index);
         }
         COMPILE::SWF
-        public function $removeChildAt(index:int):DisplayObject
+        public function $sprite_removeChildAt(index:int):DisplayObject
         {
             return super.removeChildAt(index);
         }
         COMPILE::SWF
-        public function $removeChild(child:DisplayObject):DisplayObject
+        public function $sprite_removeChild(child:DisplayObject):DisplayObject
         {
             return super.removeChild(child);
         }
         COMPILE::SWF
-        public function $getChildAt(index:int):DisplayObject
+        public function $sprite_getChildAt(index:int):DisplayObject
         {
             return super.getChildAt(index);
         }
         COMPILE::SWF
-        public function $setChildIndex(index:int):void
+        public function $sprite_setChildIndex(index:int):void
         {
             super.setChildIndex(index);
         }
         COMPILE::SWF
-        public function $getChildIndex(child:DisplayObject):int
+        public function $sprite_getChildIndex(child:DisplayObject):int
         {
             return super.getChildIndex(child);
         }
         COMPILE::SWF
-        public function $getChildByName(name:String):DisplayObject
+        public function $sprite_getChildByName(name:String):DisplayObject
         {
             return super.getChildByName(name);
         }
         COMPILE::SWF
-        public function get $numChildren():int
+        public function get $sprite_numChildren():int
         {
             return super.numChildren;
         }
         COMPILE::SWF
-        public function get $parent():DisplayObjectContainer
+        public function get $sprite_parent():DisplayObjectContainer
         {
             return super.parent;
         }
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/TextPromptBead.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/TextPromptBead.as
index a36bc3b..2865d37 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/TextPromptBead.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/accessories/TextPromptBead.as
@@ -135,11 +135,11 @@ package org.apache.royale.html.accessories
 			var model:Object = UIBase(_strand).model;
 			
 			if (model.text != null && model.text.length > 0 ) {
-				if (promptAdded) UIBase(_strand).$removeChild(promptField);
+				if (promptAdded) UIBase(_strand).$sprite_removeChild(promptField);
 				promptAdded = false;
 			}
 			else {
-				if (!promptAdded) UIBase(_strand).$addChild(promptField);
+				if (!promptAdded) UIBase(_strand).$sprite_addChild(promptField);
 				promptField.text = prompt;
 				promptAdded = true;
                 promptField.x = 2;
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/BackgroundImageBead.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/BackgroundImageBead.as
index da1108c..80771a9 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/BackgroundImageBead.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/BackgroundImageBead.as
@@ -96,7 +96,7 @@ package org.apache.royale.html.beads
 					
 					bitmap = Bitmap(LoaderInfo(e.target).content);
 					
-					host.$addChildAt(bitmap,0);
+					host.$sprite_addChildAt(bitmap,0);
 					
 					if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
 						host.setWidth(loader.content.width);
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/HScrollBarView.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/HScrollBarView.as
index 77cd622..1a51845 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/HScrollBarView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/HScrollBarView.as
@@ -86,10 +86,10 @@ package org.apache.royale.html.beads
 			_thumb = new Button();				
 			Button(_thumb).addBead(new HScrollBarThumbView());
             
-            UIBase(value).$addChild(_decrement);
-            UIBase(value).$addChild(_increment);
-            UIBase(value).$addChild(_track);
-            UIBase(value).$addChild(_thumb);
+            UIBase(value).$sprite_addChild(_decrement);
+            UIBase(value).$sprite_addChild(_increment);
+            UIBase(value).$sprite_addChild(_track);
+            UIBase(value).$sprite_addChild(_thumb);
             
             IEventDispatcher(_strand).addEventListener("widthChanged", changeHandler);
 
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/SpinnerView.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/SpinnerView.as
index 83b5bd3..a4290c4 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/SpinnerView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/SpinnerView.as
@@ -102,8 +102,8 @@ COMPILE::JS {
 				Button(_decrement).x = 0;
 				Button(_decrement).y = Button(_increment).height;
 
-				UIBase(_strand).$addChild(_decrement);
-				UIBase(_strand).$addChild(_increment);
+				UIBase(_strand).$sprite_addChild(_decrement);
+				UIBase(_strand).$sprite_addChild(_increment);
 				rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
 			}
 			IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TextFieldViewBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TextFieldViewBase.as
index 7712589..f5bfa2b 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TextFieldViewBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TextFieldViewBase.as
@@ -94,7 +94,7 @@ package org.apache.royale.html.beads
             IEventDispatcher(_strand).addEventListener("widthChanged", widthChangeHandler);
             IEventDispatcher(_strand).addEventListener("heightChanged", heightChangeHandler);
             IEventDispatcher(_strand).addEventListener("sizeChanged", sizeChangeHandler);
-			UIBase(value).$addChild(_textField);
+			UIBase(value).$sprite_addChild(_textField);
 
             var ilc:ILayoutChild = host as ILayoutChild;
             autoHeight = ilc.isHeightSizedToContent();
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/VScrollBarView.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/VScrollBarView.as
index 8aa9b8e..75e713a 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/VScrollBarView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/VScrollBarView.as
@@ -106,10 +106,10 @@ package org.apache.royale.html.beads
 			_thumb = new Button();				
 			Button(_thumb).addBead(new VScrollBarThumbView());
             
-            UIBase(value).$addChild(_decrement);
-            UIBase(value).$addChild(_increment);
-            UIBase(value).$addChild(_track);
-            UIBase(value).$addChild(_thumb);
+            UIBase(value).$sprite_addChild(_decrement);
+            UIBase(value).$sprite_addChild(_increment);
+            UIBase(value).$sprite_addChild(_track);
+            UIBase(value).$sprite_addChild(_thumb);
             
             IEventDispatcher(_strand).addEventListener("heightChanged", changeHandler);
             
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/WebBrowserView.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/WebBrowserView.as
index e84ec78..84869b6 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/WebBrowserView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/WebBrowserView.as
@@ -94,7 +94,7 @@ package org.apache.royale.html.beads
 			loader.y = 0;
 			loader.width = host.width;
 			loader.height = host.height;
-			(host as UIBase).$addChild(loader);
+			(host as UIBase).$sprite_addChild(loader);
 		}
 
 		/**
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/Legend.as b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/Legend.as
index a671ed3..8073186 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/Legend.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/Legend.as
@@ -1321,7 +1321,7 @@ package mx.charts
          *  so you can count on it to reflect what is happening at the player level.
          */
         COMPILE::JS
-        mx_internal final function get $numChildren():int
+        mx_internal final function get $sprite_numChildren():int
         {
             return super.numChildren;
         }
@@ -2870,7 +2870,7 @@ package mx.charts
             if (contentPane)
                 contentPane.addChildAt(child, index);
             else
-                $addChildAt(child, _firstChildIndex + index);
+                $uibase_addChildAt(child, _firstChildIndex + index);
             
             childAdded(child);
             
@@ -2937,7 +2937,7 @@ package mx.charts
             if (contentPane)
                 contentPane.removeChild(child);
             else
-                $removeChild(child);
+                $uibase_removeChild(child);
             
             childRemoved(child);
             
@@ -4852,7 +4852,7 @@ package mx.charts
                 _firstChildIndex++;
             
             super.addingChild(child);
-            $addChild(child);
+            $uibase_addChild(child);
             super.childAdded(child);
             
             dispatchEvent(new Event("childrenChanged"));
@@ -4880,7 +4880,7 @@ package mx.charts
             }
             
             super.addingChild(child);
-            $addChildAt(child, index);
+            $uibase_addChildAt(child, index);
             super.childAdded(child);
             
             dispatchEvent(new Event("childrenChanged"));
@@ -4912,7 +4912,7 @@ package mx.charts
             var child:IUIComponent = super.getChildAt(index);
             
             super.removingChild(child);
-            $removeChildAt(index);
+            $uibase_removeChildAt(index);
             super.childRemoved(child);
             
             if (_firstChildIndex < index &&
@@ -6687,7 +6687,7 @@ class LegendRawChildrenList implements IChildList
      */
     public function get numChildren():int
     {
-        return owner.$numChildren;
+        return owner.$sprite_numChildren;
     }
     
     //--------------------------------------------------------------------------
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as
index 5a990ce..823ab1e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as
@@ -941,7 +941,7 @@ public class MenuBar extends UIComponent implements IFocusManagerComponent, ICon
         var arr:Array = [];
         COMPILE::SWF
         {
-            var itemHolder:UIBase = $getChildAt(0) as UIBase;
+            var itemHolder:UIBase = $sprite_getChildAt(0) as UIBase;
         }
         COMPILE::JS
         {
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
index 7759b57..ece98e5 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
@@ -119,7 +119,7 @@ package mx.controls.beads
             upTextField.parentHandlesPadding = true;
             downTextField.parentHandlesPadding = true;
             overTextField.parentHandlesPadding = true;
-            UIBase(value).$addChild(upSprite);
+            UIBase(value).$sprite_addChild(upSprite);
             /* TODO switch sprites on mouse state 
 			SimpleButton(value).downState = downSprite;
 			SimpleButton(value).overState = overSprite;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CheckBoxView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CheckBoxView.as
index 227cb36..49f7c5c 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CheckBoxView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CheckBoxView.as
@@ -129,7 +129,7 @@ package mx.controls.beads
 			hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height);
 			hitArea.graphics.endFill();
 			
-            UIBase(value).$addChild(upSprite);
+            UIBase(value).$sprite_addChild(upSprite);
             /* TODO switch sprites on mouse state 
 			SimpleButton(value).downState = downSprite;
 			SimpleButton(value).overState = overSprite;
@@ -233,7 +233,7 @@ package mx.controls.beads
 			layoutControl();
 			
 			if( value ) {
-                UIBase(_strand).$addChild(upAndSelectedSprite);
+                UIBase(_strand).$sprite_addChild(upAndSelectedSprite);
                 upAndSelectedSprite.visible = true;
                 upSprite.visible = false;
                 /* TODO switch sprites on mouse state 
@@ -241,7 +241,7 @@ package mx.controls.beads
 				SimpleButton(_strand).overState = overAndSelectedSprite;
 				*/
 			} else {
-                UIBase(_strand).$addChild(upSprite);
+                UIBase(_strand).$sprite_addChild(upSprite);
                 upAndSelectedSprite.visible = false;
                 upSprite.visible = true;
                 /* TODO switch sprites on mouse state 
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/RadioButtonView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/RadioButtonView.as
index 0c3fbf2..2486d21 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/RadioButtonView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/RadioButtonView.as
@@ -130,12 +130,12 @@ package mx.controls.beads
 			
 			layoutControl();
 			
-            UIBase(value).$addChild(upSprite);
-            UIBase(value).$addChild(downSprite);
-            UIBase(value).$addChild(overSprite);
-            UIBase(value).$addChild(upAndSelectedSprite);
-            UIBase(value).$addChild(downAndSelectedSprite);
-            UIBase(value).$addChild(overAndSelectedSprite);
+            UIBase(value).$sprite_addChild(upSprite);
+            UIBase(value).$sprite_addChild(downSprite);
+            UIBase(value).$sprite_addChild(overSprite);
+            UIBase(value).$sprite_addChild(upAndSelectedSprite);
+            UIBase(value).$sprite_addChild(downAndSelectedSprite);
+            UIBase(value).$sprite_addChild(overAndSelectedSprite);
             host = Sprite(value);
             host.mouseEnabled = true;
             host.buttonMode = true;
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 49416df..7139394 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
@@ -343,7 +343,7 @@ public class Application extends Container implements IStrand, IParent, IEventDi
     [SWFOverride(returns="flash.display.DisplayObjectContainer")]
     override public function get parent():IParent
     {
-        var p:* = $parent;
+        var p:* = $sprite_parent;
         return p;
     }
     }
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 f637555..80bce98 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -26,7 +26,6 @@ import flash.display.BlendMode;
 import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
 import flash.display.GradientType;
-import flash.display.Graphics;
 import flash.display.InteractiveObject;
 import flash.display.Loader;
 import flash.display.Shader;
@@ -40,6 +39,10 @@ import flash.events.IEventDispatcher;
 
 import mx.controls.beads.ToolTipBead;
 import mx.core.mx_internal;
+COMPILE::SWF
+{
+import flash.display.Graphics;
+}
 import mx.display.Graphics;
 import mx.events.EffectEvent;
 import mx.events.FlexEvent;
@@ -602,18 +605,40 @@ public class UIComponent extends UIBase
 	//----------------------------------
     //  graphics copied from Sprite
     //----------------------------------
-		private var _graphics:Graphics;
+		private var _graphics:mx.display.Graphics;
 
-        [SWFOverride(returns="flash.display.Graphics"))]
-        COMPILE::SWF 
-        { override }
+        COMPILE::SWF
+        override public function get graphics():flash.display.Graphics
+        {
+            // in SWF, beads that are compiled against UIBase
+            // outside of the emulation components will call
+            // this expecting flash.display.Graphics.
+            // Calls from within the emulation components should
+            // resolve to royalegraphics below.
+            // this override for SWF must be here in order
+            // for the compiler to know which calls to map to
+            // royalegraphics.  Emulation Components should resolve
+            // calls to UIComponent.graphics and non-Emulation
+            // Components should resolve to Sprite.graphics
+            return super.graphics;        
+        }
+        
+        COMPILE::JS
 		public function get graphics():Graphics
 		{
             if (_graphics == null)
                 _graphics = new mx.display.Graphics(this);
 			return _graphics;
 		}
-        
+
+        // the compiler will resolve access to graphics with royalegraphics
+        public function get royalegraphics():mx.display.Graphics
+        {
+            if (_graphics == null)
+                _graphics = new mx.display.Graphics(this);
+            return _graphics;
+        }            
+            
     COMPILE::JS{
 	private var _mask:UIComponent;
 		 public function set mask(value:UIComponent):void
@@ -3087,13 +3112,12 @@ COMPILE::JS
         return addElement(child) as IUIComponent;
     }
     
-    [SWFOverride(params="flash.display.DisplayObject", altparams="mx.core.UIComponent", returns="flash.display.DisplayObject"))]
-    COMPILE::SWF 
-    { override }
-    public function $addChild(child:IUIComponent):IUIComponent
+    
+    public function $uibase_addChild(child:IUIComponent):IUIComponent
     {
         // this should avoid calls to addingChild/childAdded
-        return super.addElement(child) as IUIComponent;
+        var ret:IUIComponent = super.addElement(child) as IUIComponent;
+        return ret;
     }
 
     /**
@@ -3109,16 +3133,16 @@ COMPILE::JS
         return addElementAt(child, index) as IUIComponent;
     }
     
-    [SWFOverride(params="flash.display.DisplayObject,int", altparams="mx.core.UIComponent,int", returns="flash.display.DisplayObject"))]
-    COMPILE::SWF 
-    { override }
-    public function $addChildAt(child:IUIComponent,
+    public function $uibase_addChildAt(child:IUIComponent,
                                index:int):IUIComponent
     {
+        var ret:IUIComponent;
         // this should avoid calls to addingChild/childAdded
         if (index >= super.numElements)
-            return super.addElement(child) as IUIComponent;
-        return super.addElementAt(child, index) as IUIComponent;
+            ret = super.addElement(child) as IUIComponent;
+        else
+            ret = super.addElementAt(child, index) as IUIComponent;
+        return ret;
     }
 
     /**
@@ -3133,13 +3157,11 @@ COMPILE::JS
         return removeElement(child) as IUIComponent;
     }
     
-    [SWFOverride(params="flash.display.DisplayObject", altparams="mx.core.UIComponent", returns="flash.display.DisplayObject"))]
-    COMPILE::SWF 
-    { override }
-    public function $removeChild(child:IUIComponent):IUIComponent
+    public function $uibase_removeChild(child:IUIComponent):IUIComponent
     {
         // this should probably call the removingChild/childRemoved
-        return super.removeElement(child) as IUIComponent;
+        var ret:IUIComponent = super.removeElement(child) as IUIComponent;
+        return ret;
     }
     
     COMPILE::JS
@@ -3160,12 +3182,10 @@ COMPILE::JS
         return removeElement(getElementAt(index)) as IUIComponent;
     }
     
-    [SWFOverride(returns="flash.display.DisplayObject"))]
-    COMPILE::SWF 
-    { override }
-    public function $removeChildAt(index:int):IUIComponent
+    public function $uibase_removeChildAt(index:int):IUIComponent
     {
-        return super.removeElement(getElementAt(index)) as IUIComponent;
+        var ret:IUIComponent = super.removeElement(getElementAt(index)) as IUIComponent;
+        return ret;
     }
 
     /**
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/TextBase.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/TextBase.as
index a938750..23f1b52 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/TextBase.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/TextBase.as
@@ -970,7 +970,7 @@ public class TextBase extends UIComponent
             // Add new TextLine accounting for our background Shape.
             COMPILE::SWF
             {
-                $addChildAt(textLine as IUIComponent, 1);
+                $uibase_addChildAt(textLine as IUIComponent, 1);
             }
             COMPILE::JS
             {
@@ -1000,7 +1000,7 @@ public class TextBase extends UIComponent
             {
                 COMPILE::SWF
                 {
-                    UIComponent(textLine.parent).$removeChild(textLine as IUIComponent);                        
+                    UIComponent(textLine.parent).$uibase_removeChild(textLine as IUIComponent);                        
                 }
                 COMPILE::JS
                 {