Flash Action Script Error Repository

A library of solutions to Actionscript, Flash, Flex and AIR

Archive for May, 2010

Multiple sets of visual children have been specified for the component tag

Multiple sets of visual children have been specified for the component tag.

You have contents in the default property of a container but also defined in the custom component. Remove the contents of the component instance and if need be move it into the component mxml file.

XML:
  1. <!-- Incorrect - notice the rectangle inside the component instance -->
  2. <local:CustomComponent  x="135" y="9" width="457" height="340">
  3.     <s:Rect width="100%" height="100%">
  4.         <s:fill>
  5.             <s:SolidColor color="#dddddd"/>
  6.         </s:fill>
  7.     </s:Rect>
  8. </local:CustomComponent>
  9.  
  10. <!-- Correct - rectangle is defined in the component -->
  11. <local:CustomComponent  x="135" y="9" width="457" height="340" />

No comments