Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

mouse down and mouse up produces 2 different objects?
Started by mindstems Nov 14 2009 12:36 AM

- - - - -
2 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

mindstems

[GLOBAL: userInfoPane.html]
mindstems
  • Observer

  • 12 posts
  • Guests

I'm working on a drawing type of app. It seems that when I click the mouse it draws a dot and when I release the mouse it draws a second dot... how do I prevent this second dot?

uid: 1896 topic_id: 236 reply_id: 300236


[TOPIC: post.html]
#2

DGuy

[GLOBAL: userInfoPane.html]
DGuy
  • Enthusiast

  • 38 posts
  • Guests

(I assume your using the "touch" event)

Check the 'event.phase' property.

A touch can have up to 5 phases: "began", "moved", "ended", "stationary" & "canceled"*

*the docs say "cancelled" but I'm sure its a typo.

HTH,
David
uid: 1581 topic_id: 236 reply_id: 302


[TOPIC: post.html]
#3

mindstems

[GLOBAL: userInfoPane.html]
mindstems
  • Observer

  • 12 posts
  • Guests

Thanks David,

So I'll use the event phases to do the drawing action. Thanks!
uid: 1896 topic_id: 236 reply_id: 303



[topic_controls]
[/topic_controls]