import mx.core.UIComponent

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of timgerr
Sent: Tuesday, August 05, 2008 10:06 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Questions about DragManager



Hello all, I am working on a drag and drop component and I have a few
questions if ya don't mind.

I am seeing this DragManager
(http://weblogs.macromedia.com/pent/archives/2006/11/tree_drag_and_d.htm
l
<http://weblogs.macromedia.com/pent/archives/2006/11/tree_drag_and_d.htm
l> )
and other places, so when I add it I get an error. Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
layout="absolute">
<mx:HTTPService id="xmlLoader"
url="http://miys02ae211935l.miys02.gd-ais.com/try/fruitDB/v1.php
<http://miys02ae211935l.miys02.gd-ais.com/try/fruitDB/v1.php> "
resultFormat="e4x" contentType="application/xml"
result="xmlReturned(event)"/>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " width="400"
height="300" left="20"
top="10">
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.events.DragEvent;
import mx.core.DragSource;

[Bindable]
private var xmlValue:XMLListCollection;

private function xmlReturned(event:Event):void
{
xmlValue = new XMLListCollection(new
XMLList(xmlLoader.lastResult));
}
private function onDragEnter( event:DragEvent ) : void
{
DragManager.acceptDragDrop(UIComponent(event.currentTarget));
}


]]>
</mx:Script>
<mx:Button click="xmlLoader.send()" label="get XML"/>
<mx:Tree dataProvider="{xmlValue}" y="100" labelField="@label"
width="300" 
showRoot="true"/>
</mx:Canvas>
</mx:Application>

I get an error at the function:
private function onDragEnter( event:DragEvent ) : void
{
DragManager.acceptDragDrop(UIComponent(event.currentTarget));
}
*error is "Call to a pssibly undefined method UIComponent. I am not
sure if I have to declare DragManager????

What am I doing wrong?

Thanks for the help,
Timgerr



 

Reply via email to