简体   繁体   中英

ActionScript 3 No Mouse Click When Mouse Moves

I have different elements in a scroller:

protected var theScroll:Scroller = new Scroller();

Every Element got an EvenetListener:

mc1.addEventListener(MouseEvent.MOUSE_DOWN, showMC, false, 0, true);

If a user wants to scroll the elements the EventListener is called and the user can't scroll.

How can I check whether a user wants to scroll or click?

Any ideas?

Best Janine

Set a mouse down flag in your element at the mouse down handler, if that boolean flag is true and you are having a mouse move event (check it at mouse move handler) then that means user is trying to drag. Do not forget to reset the flag when mouse goes up. FYI: Flex has a drag event.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM