What error are you getting?
that is exactly the problem. I get no error the DragManager.doDrag is simply not working. If i put everything in a try-catch block nothing appears. So everything seems to work fine but the doDrag method doesn't work.
var dragInitiator:Button = Button(event.currentTarget);
var dragSource:DragSource = new DragSource();
dragSource.addData("add_something", "some data");
// Create a copy of the image to use as a drag proxy.
var img:BitmapAsset = new buttonIcon() as BitmapAsset;
var dragImg:Image = new Image();
dragImg.source = img;
// calculate dragImage offset
var offset:Point = new Point(event.localX - img.width / 2, event.localY - img.height / 2);
DragManager.doDrag(dragInitiator, dragSource, event, dragImg, offset.x, offset.y);
this.label += e.errorID + "; " + e.name + "; " + e.message;
Normally there is a whole protocol to drag/drop. It starts with a mouseDown
then a mouseMove while the mouse is down. It looks like your code will fire
on any mouseMove and there is probably code in DragManager that thinks the
drag is over if the mouseEvent.buttonDown is false.
If i set the dragIt(event) method to mouseDown, mouseMove or both the Desktop Version works fine but not on Android.
The code is based on flex livedoc example:
There is only a handler for mouseMove to initiate the DragManager.doDrag(...).
In a further example the DragManager is initiated by the mouseDown event.
It doesn't matter because the DragManager gets the mouseEvent directly (third parameter) and can check
mouseDown = true internally.
Every other Mouse or Touch Events are working fine in my application on Android and Desktop.
We are also working with a Dell Latitude XT2 Multitouch Notebook and the DragManager works with fingers.
I found the reason for the not working DragManager. It is depending on the operating system.
If you use Windows 7 every TouchEvent is converted to a MouseEvent and the DragManager is working properly.
But if your Flex Application is running on an Android System not every TouchEvent is converted to an MouseEvent (MouseClicks works for example).
It happens that the DragManager.doDrag is not receiving the necessary MouseMove Events from TouchMove because of the missing conversion.
One solution would be to cast/convert every TouchEvent into a MouseEvent for the DragManager.
The second solution could be the adoption of the DragManager to TouchEvents.