Permalink
Browse files

do not fire drag complete events if not dragging. fixes #3.

  • Loading branch information...
1 parent 8cb30e6 commit 7e3dd41ce04f56e8db3a8dde9771fea46b50ffa4 @trun committed Jan 31, 2012
@@ -65,6 +65,7 @@
if (this.contains(block)) {
removeChild(block);
}
+ block = null;
}
public function getAllBlocks():Array {
@@ -148,7 +148,9 @@
}
protected function onMouseUp(e:MouseEvent):void {
- dispatchEvent(new BlockDragEvent(BlockDragEvent.DRAG_COMPLETE, false, false, this, null));
+ if (isDragging()) {
+ dispatchEvent(new BlockDragEvent(BlockDragEvent.DRAG_COMPLETE, false, false, this, null));
+ }
}
protected function onMouseMove(e:MouseEvent):void {
@@ -1,11 +1,13 @@
package com.flashblocks.blocks.args {
import com.flashblocks.blocks.Block;
import com.flashblocks.blocks.BlockType;
+ import com.flashblocks.blocks.SimpleBlock;
import com.flashblocks.blocks.render.BlockFlatBottom;
import com.flashblocks.blocks.render.BlockFlatTop;
- import com.flashblocks.blocks.SimpleBlock;
import com.flashblocks.events.BlockConnectionEvent;
+
import flash.filters.BevelFilter;
+
import mx.controls.Spacer;
/**

0 comments on commit 7e3dd41

Please sign in to comment.