Link to home
Start Free TrialLog in
Avatar of thebellman
thebellmanFlag 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

Avatar of zzynx
zzynx
Flag of Belgium image

You get this error at what line of code?
Avatar of 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
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I wish I could have helped you better.
Thanx 4 axxepting