flushEvents("mouseUp")
Posted: Fri Jul 24, 2009 2:39 am
Hi All,
I have read, and re-read all postings I could find regarding flushEvents, lock messages, and other key phrases related to flushing the buffer of unwanted mouse clicks. What I have tried so far:
Overview
I have 12 images on the screen. A string of 3-5 images must be clicked in the correct order for a correct score. If a wrong image is clicked, I want to process that and not allow any further mouseUp messages.
Problem
Users can click on an incorrect image followed by any other image. The mouseUp from that subsequent click current carries over and is processed as the first guess to the next question.
Failed Attempt A
Setting the disabled of all the images immediately after any of the images is clicked.
Failed Attempt B
1. lock messages
2. process answer
3. unlock messages
Failed Attempt C
1. lock messages
2. get flushEvents("mouseUp")
3. process answer
4. unlock messages
Failed Attempt D
1. I created a global okayToClick
2. Play audio
3. okayToClick = true
4. upon mouseUp on any of the 12 images, okayToClick = false
5. The 12 images have an "if" statement to evaluate okayToClick
5A - if true, process the click (call a function)
5B - if false, do nothing
I spent considerable time with the documentation, this forum, and the listserv, but cannot seem to find the key. It is frustrating to get stuck on the little stuff.
Any help would be greatly appreciated.
Thanks,
Ed
I have read, and re-read all postings I could find regarding flushEvents, lock messages, and other key phrases related to flushing the buffer of unwanted mouse clicks. What I have tried so far:
Overview
I have 12 images on the screen. A string of 3-5 images must be clicked in the correct order for a correct score. If a wrong image is clicked, I want to process that and not allow any further mouseUp messages.
Problem
Users can click on an incorrect image followed by any other image. The mouseUp from that subsequent click current carries over and is processed as the first guess to the next question.
Failed Attempt A
Setting the disabled of all the images immediately after any of the images is clicked.
Failed Attempt B
1. lock messages
2. process answer
3. unlock messages
Failed Attempt C
1. lock messages
2. get flushEvents("mouseUp")
3. process answer
4. unlock messages
Failed Attempt D
1. I created a global okayToClick
2. Play audio
3. okayToClick = true
4. upon mouseUp on any of the 12 images, okayToClick = false
5. The 12 images have an "if" statement to evaluate okayToClick
5A - if true, process the click (call a function)
5B - if false, do nothing
I spent considerable time with the documentation, this forum, and the listserv, but cannot seem to find the key. It is frustrating to get stuck on the little stuff.
Any help would be greatly appreciated.
Thanks,
Ed