Hi,
I am trying to drag boxes between DataGrid columns. I get the
following code:
1120: Access of undefined property DnDManager.
I am importing a custom component called dNdLib. I am creating a
DataGrid and using itemRenderer to create boxes within the
DataGridColumn. When I create a mouseDown event in the box , I get the
Access to an undefined property.
Any kind of help is much appreciated.
Thanks in advance,
Chetan
Following is my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
layout="vertical"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:containers="dNdLib.containers.*">
<mx:Script>
<![CDATA[
import dNdLib.managers.DnDManager;
]]>
</mx:Script>
<mx:Panel id="panel" width="100%" height="100%" layout="horizontal">
<mx:DataGrid width="100%" height="100%">
<mx:columns>
<mx:DataGridColumn width="200">
<mx:itemRenderer>
<mx:Component>
<containers:DnDContainer width="200" height="100%"
horizontalAlign="center" verticalAlign="middle" paddingTop="10"
verticalGap="10"
direction="vertical" borderStyle="solid"
backgroundColor="blue" backgroundAlpha=".25">
<mx:Box backgroundColor="red" width="150" height="150"
mouseDown="DnDManager.getInstance().doDrag(event)"/>
<mx:Box backgroundColor="purple" width="150" height="150"
mouseDown="DnDManager.getInstance().doDrag(event)"/>
<mx:Box backgroundColor="black" width="150" height="150"
mouseDown="DnDManager.getInstance().doDrag(event)"/>
</containers:DnDContainer>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn width="200">
<mx:itemRenderer>
<mx:Component>
<containers:DnDContainer width="100%"
height="200"
horizontalAlign="center" verticalAlign="middle" paddingTop="10"
verticalGap="10"
direction="horizontal" borderStyle="solid"
backgroundColor="blue" backgroundAlpha=".25">
<mx:Box backgroundColor="yellow" width="150"
height="150" mouseDown="DnDManager.getInstance().doDrag(event)"/>
<mx:Box backgroundColor="green" width="150"
height="150" mouseDown="DnDManager.getInstance().doDrag(event)"/>
<mx:Box backgroundColor="blue" width="150"
height="150" mouseDown="DnDManager.getInstance().doDrag(event)"/>
</containers:DnDContainer>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn width="200">
<mx:itemRenderer>
<mx:Component>
<containers:DnDContainer width="100%"
height="200"
horizontalAlign="center" verticalAlign="middle" paddingTop="10"
verticalGap="10"
direction="horizontal" borderStyle="solid"
backgroundColor="blue" backgroundAlpha=".25"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>