actionscript 3 - After end of MouseMove or drag event menu keeping from release menu items -


i having problem draggable menu including menu button items. @ end of drag operation (when lift finger screen) button sub item works because of mouse_up code.

i need drag end drop menu. after drop menu button items listeners should start release (mouse_up). how can separete them?

i read similar messages couldnt solve problem.

my code:

addeventlistener(mouseevent.mouse_move, dragstart);  addeventlistener(mouseevent.mouse_up, dragstop);  function dragstart(e:mouseevent):void {     e.currenttarget.startdrag(false,new rectangle(0,0,500,0));  } function dragstop(e:mouseevent):void {      e.currenttarget.stopdrag(false,new rectangle(0,0,500,0));  } 

thanks..

my sample file here

update:
getting wrong. i'd suggest switching flag in parent clip when dragged , ignore mouse_up events in children if true.

in parent:

var dragging:boolean = false;  function dragstart(e:mouseevent):void{     e.currenttarget.startdrag(false,new rectangle(0,0,500,0));     dragging = true; } function dragstop(e:mouseevent):void{     e.currenttarget.stopdrag();     removeeventlistener(mouseevent.mouse_move, dragstart);     dragging = false; } 

in subitem:

function btn(e:mouseevent):void{     if(!(parent movieclip).dragging){         trace("i'm button: "+this+" did hit me when sliding?");     }    } 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -