import mx.core.DragSource;
import mx.managers.DragManager;
import mx.events.*;
import mx.containers.Canvas;
private function mouseMoveHandler(event:MouseEvent):void {
var dragInitiator:Canvas=Canvas(event.currentTarget);
var dragColor:int = dragInitiator.getStyle('backgroundColor');
var ds:DragSource = new DragSource();
ds.addData(dragColor, 'color');
DragManager.doDrag(dragInitiator, ds, event);
}
private function dragEnterHandler(event:DragEvent):void {
if (event.dragSource.hasFormat('color')) {
var dropTarget:Canvas=Canvas(event.currentTarget);
DragManager.acceptDragDrop(dropTarget);
}
}
private function dragDropHandler(event:DragEvent):void {
var data:Object = event.dragSource.dataForFormat('color');
myCanvas.setStyle("backgroundColor", data);
}