estanglerbm opened a new issue #963:
URL: https://github.com/apache/royale-asjs/issues/963


   In Flash Debug Player--after dealing with various VerifyError issues related 
to issue #953--getting error
   
   `ArgumentError: Error #2024: An object cannot be added as a child of itself.`
   
   on any Spark application (haven't tried other types).  Full stack:
   
   ```
   ArgumentError: Error #2024: An object cannot be added as a child of itself.
        at flash.display::DisplayObjectContainer/addChild()
        at 
org.apache.royale.core::UIBase/$sprite_addChild()[/org/apache/royale/0.9.8/org/apache/royale/core/UIBase.as:1564]
        at 
org.apache.royale.core::UIBase/addElement()[/org/apache/royale/0.9.8/org/apache/royale/core/UIBase.as:1170]
        at 
mx.core::UIComponent/addElement()[/org/apache/royale/0.9.8/mx/core/UIComponent.as:6109]
        at 
spark.components::SkinnableContainer/$addElement()[/org/apache/royale/0.9.8/spark/components/SkinnableContainer.as:1384]
        at 
org.apache.royale.core::ContainerBaseStrandChildren/addElement()[/org/apache/royale/0.9.8/org/apache/royale/core/ContainerBaseStrandChildren.as:67]
        at 
org.apache.royale.html.beads::ContainerView/addViewport()[/org/apache/royale/0.9.8/org/apache/royale/html/beads/ContainerView.as:147]
        at 
spark.components.beads::SkinnableContainerView/addViewport()[/org/apache/royale/0.9.8/spark/components/beads/SkinnableContainerView.as:120]
        at org.apache.royale.html.beads::ContainerView/set 
strand()[/org/apache/royale/0.9.8/org/apache/royale/html/beads/ContainerView.as:139]
        at spark.components.beads::SparkContainerView/set 
strand()[/org/apache/royale/0.9.8/spark/components/beads/SparkContainerView.as:65]
        at 
org.apache.royale.core::HTMLElementWrapper/addBead()[/org/apache/royale/0.9.8/org/apache/royale/core/HTMLElementWrapper.as:66]
        at 
org.apache.royale.core::UIBase/addBead()[/org/apache/royale/0.9.8/org/apache/royale/core/UIBase.as:1143]
        at 
global/org.apache.royale.utils::loadBeadFromValuesManager()[/org/apache/royale/0.9.8/org/apache/royale/utils/loadBeadFromValuesManager.as:55]
        at 
org.apache.royale.core::UIBase/addedToParent()[/org/apache/royale/0.9.8/org/apache/royale/core/UIBase.as:1398]
        at 
mx.core::UIComponent/addedToParent()[/org/apache/royale/0.9.8/mx/core/UIComponent.as:1991]
        at 
spark.components::SkinnableContainer/addedToParent()[/org/apache/royale/0.9.8/spark/components/SkinnableContainer.as:980]
        at 
mx.managers::SystemManager/addChild()[/org/apache/royale/0.9.8/mx/managers/SystemManager.as:1596]
        at 
mx.managers::SystemManager/initializeTopLevelWindow()[/org/apache/royale/0.9.8/mx/managers/SystemManager.as:2987]
        at 
mx.managers::SystemManager/kickOff()[/org/apache/royale/0.9.8/mx/managers/SystemManager.as:2831]
        at 
mx.managers::SystemManager/docFrameHandler()[/org/apache/royale/0.9.8/mx/managers/SystemManager.as:2710]
   ```
   
   Ultimately, this is because ContainerView.addViewport() is doing:
   
   `chost.strandChildren.addElement(viewport.contentView);`
   
   where chost == viewport.contentView, because 
SkinnableContainerView.addViewport() is not checking that chost != 
viewport.contentView before calling super.addViewport().
   
   (Then the SWF-specific code in UIBase.addElement() is calling 
$sprite_addChild(), which doesn't like it.)
   
   What needs to be added with addElement, in the SWF case?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to