Avatar of thebellman
thebellman
Flag for United States of America asked on

DisplayObject must be a child of the caller

I can't seem to figure why I'm getting this error:

The supplied DisplayObject must be a child of the caller.

I'm trying to populate a ComboBox with a itemRenderer.  I'm guessing that the parent display object is loading before the child is ready, but I'm not sure how to fix?

Any ideas?

Thanks,

John
<?xml version="1.0" encoding="utf-8"?>
<mx:Application 	xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"		>
<mx:Script>
	<![CDATA[
import mx.events.DragEvent;
import mx.managers.DragManager;
private function dragEnterRows(event:DragEvent):void
    	{    		
    		DragManager.acceptDragDrop(rowsBox);
    	}
]]>
</mx:Script>	
	<mx:Canvas width="749" height="232" x="53" y="14">
		<mx:ComboBox id="comboBox" dataProvider="{[' ']}"
		itemRenderer="ComboItemRenderer"  width="190" x="19" y="12">
		
		</mx:ComboBox>
		<mx:VBox id="rowsBox" height="174" width="259" dragEnter="dragEnterRows(event)" 
				dragDrop="" dragOver=""
				 toolTip="Drop Row Fields Here"
				borderColor="0xFFFFFF" borderStyle="solid" x="453" y="20"/>
	</mx:Canvas>
</mx:Application>


<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/09/25/creating-a-custom-combobox-item-renderer-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:fc="comps.*"        layout="vertical"        verticalAlign="top"        backgroundColor="white">
<mx:Script>
		<![CDATA[			import mx.collections.XMLListCollection;					]]>
	</mx:Script>
<mx:VBox width="100" height="100%">
	<!--		<fc:DimensionList dataProvider="{['MarketValue', 'Volume', 'RiskCapital_1Yr']}" height="100%" width="100%" id="m1"  color= "0x000000" />-->
			<mx:Label text="hello" />
</mx:VBox>
</mx:Application>

Open in new window

Apache Flex

Avatar of undefined
Last Comment
zzynx

8/22/2022 - Mon
zzynx

You get this error at what line of code?
thebellman

ASKER
The error is in the Display ObjectContainer within the main thread of the flash movie.  It doesn't error on any one line of code.  I've attached the debug stop points and error messages as an image.

Thanks!


-John
thread-error-flex.jpg
SOLUTION
zzynx

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
thebellman

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
zzynx

I wish I could have helped you better.
Thanx 4 axxepting
Your help has saved me hundreds of hours of internet surfing.
fblack61