-
After end of MouseMove or drag event menu keeping from release menu items
I try to make a simple game. Users can add any object from slider list by tapping. Slider list menu is larger than screen size. So user can drag the menu lefto right or vice versa. Slider menu list is ok. But after siliding (move event) with lifting finger on the screen without choosing a button that dermined by depending on the finger on which button works. I am having a problem with draggable menu including menu button items. At the end of drag operation (when I lift my finger from the screen) a button sub item works because of its MOUSE_UP code.
I need drag end drop my menu. After drop menu button items listeners should start for release (MOUSE_UP). How can I separete them?
I read some similar messages but I couldnt solve my problem.
Sory for my poor English.
My code:
PHP 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)); }
-
Senior Member
addEventListener has more than 2 params, you can use 'useCapture' and / or 'priority' to control the order that event listeners are called in. also there are stopPropagation and stopImmediatePropagation in events that can block other listeners from being called (e g if you dont want to trigger the button after you dropped it).
-
Thanks realMakc,
How can I use your advise in this sample file?
http://1e1ders.net/SliderButtons.rar
-
.
Hi,
If you publish your movie for AIR 3.4 for Android instead of AIR 3.2 for Android as you have, you will be able to use MouseEvent.RELEASE_OUTSIDE
PHP Code:
addEventListener(MouseEvent.MOUSE_DOWN,dragStart);
addEventListener(MouseEvent.MOUSE_UP, dragStop);
addEventListener(MouseEvent.RELEASE_OUTSIDE ,dragStop);
function dragStart(e:MouseEvent):void { e.currentTarget.startDrag(false,new Rectangle(0,0,500,0)); }
function dragStop(e:MouseEvent):void { stopDrag(); }
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|