first make ds:DragSource as public.
private function dragDropHandler(event:DragEvent):void
{
// Canvas(event.currentTarget).x= this
(event.currentTarget).mouseX;
// Canvas(event.currentTarget).y= this
(event.currentTarget).mouseY;
ds.dataForFormat("canvas").x = 50; // or wahatever you want to
assign
ds.dataForFormat("canvas").y = 50; // or wahatever you want to
assign
}
Or the area on which you are dropping have the scrollbars ???
Thanks,
Vaibhav.
On May 12, 2:31 pm, Vamsi Nagavalli <[email protected]> wrote:
> Hi guys,
>
> I am new this group and have been with flex for only 2 months....
>
> This journey was very exiting and could do most of the work with less
> help....
>
> Earlier I have tried to drag and drop an Map Marker( ESRI) to a
> different location on the Map and was successful.....
>
> But now when I am trying to drag and drop a Canvas to a new position
> on the screen.... I was unsuccessful.. Can any one help me out with
> this task....
>
> Here is a my code snippet that I have tried now.....
>
> private function enableMove(event:MouseEvent):void
> {
> var dragInitiator:Canvas=
> Canvas(event.currentTarget);
> var ds:DragSource= new DragSource();
> ds.addData(dragInitiator,"canvas");
>
> DragManager.doDrag(dragInitiator,ds,event);
> }
>
> private function
> dragEnterHandler(event:DragEvent):void
> {
> if( event.dragSource.hasFormat("canvas"))
> {
>
> DragManager.acceptDragDrop(this(event.currentTarget));
> }
> }
>
> private function dragDropHandler(event:DragEvent):void
> {
> Canvas(event.currentTarget).x=
> this(event.currentTarget).mouseX;
> Canvas(event.currentTarget).y=
> this(event.currentTarget).mouseY;
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---