Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Why not use the property <code>isDragging</code> of <code>DragManager</code> if you are doig a drag you dont need to change the cursor. And dont forget to check for the <code>dragExit</code> event in case you drop outside the datagrid.</p> <p>N.B sometimes the cursor keep with the dragging shape after the drop so you can in your <code>sectQuestReOrder</code> remove the cursor and set it back to over state.</p> <p>sample:</p> <pre><code>public function over(evt:Event):void{ //on mouse over, added with AS if (DragManager.isDragging) // you are dragging so no cursor changed return; CursorManager.removeAllCursors(); CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,-7,-7); var styleSheet:CSSStyleDeclaration = StyleManager.getStyleDeclaration("DragManager"); styleSheet.setStyle("moveCursor",grabbingCursor); //style set for the drag cursor } public function down(evt:Event):void{ // on mouse down CursorManager.removeAllCursors(); CursorManager.setCursor(grabbingCursor,CursorManagerPriority.LOW,-7,-7); } public function up(evt:Event):void{ CursorManager.removeAllCursors(); CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,-7,-7); } public function out(evt:Event):void{ if (DragManager.isDragging) // you are dragging so no cursor changed return; CursorManager.removeAllCursors(); } public function sectQuestReOrder(e:Event):void{ // sometime you will be stuck with the moving cursor // so after the drop done reset cursor to what you want CursorManager.removeAllCursors(); CursorManager.setCursor(grabCursor,CursorManagerPriority.LOW,-7,-7); ... } public function onDragExit(e:Event):void { // in case you go out of the datagrid reset the cursor // so when you do a drop outside you ll not get one of your dragging cursor CursorManager.removeAllCursors(); } </code></pre> <p>And in your grid add dragExit</p> <pre><code> &lt;mx:DataGrid id="sectQuestionsDG" x="10" y="204" width="558" height="277" headerHeight="0" selectable="{editMode}" dragExit="onDragExit(event)" dragMoveEnabled="{editMode}" dragEnabled="{editMode}" dropEnabled="{editMode}" dragDrop="sectQuestReOrder(event);" rollOver="over(event);" mouseDown="down(event);" mouseUp="up(event);" rollOut="out(event);"/&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload