1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| //fonctions pour drag and drop ( 3 fonctions)
private function mouseMoveHandler(event:MouseEvent):void
{
if(!event.ctrlKey)
{ sup=1;
var dragInitiator:TextArea=TextArea(event.currentTarget);
var ds:DragSource = new DragSource();
ds.addData(dragInitiator, "TextArea");
DragManager.doDrag(dragInitiator, ds, event);
}
else if (event.ctrlKey)
{
modif();
}
}
private function dragEnterHandler(event:DragEvent):void {
if (event.dragSource.hasFormat("TextArea"))
{
DragManager.acceptDragDrop(Canvas(event.currentTarget));
}
}
private function dragDropHandler(event:DragEvent):void {
TextArea(event.dragInitiator).x =
Canvas(event.currentTarget).mouseX + 190;
TextArea(event.dragInitiator).y =
Canvas(event.currentTarget).mouseY + 40;
} |