Doubble clicking?

Post your own tutorials, guides and demos.

Post » Thu Apr 02, 2009 9:57 pm

In this cap you can create two rectangles. If you click the mouse the blue one will appear. If you click the mouse and the blue one is visible, the red one should appear. Her's the wierd thing:

If you click, and then click again within the doubble-click time (which depends on how your computer is configured) it doesn't reveal the red one. It looks like it's counting the second click as just a part of a doubble-click. If you try to change the doubble-click speed of your computer you will see that it affects the behavior of the application.

Is this intentional?
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Fri Apr 03, 2009 9:56 am

Its probably becouse when you click again right after sprite is not visible yet.
ps. if you switch events, both will go visible :P.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Fri Apr 03, 2009 12:36 pm

Read again. You're missing the point completely.

[quote:jonk0p9r]Its probably becouse when you click again right after sprite is not visible yet.[/quote:jonk0p9r]

The sprite is visible 1/60 of a second after i click again. I don't click that fast. And as i said, it changes when i change the doubble click speed. At slowest i can wait like 2/3 of a second before the second click, and it still doesn't reveal the red box.

[quote:jonk0p9r]ps. if you switch events, both will go visible :P.[/quote:jonk0p9r]
Of course they will.. I could also put the actions in the same event. But that's not what i'm talking about.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Fri Apr 03, 2009 12:40 pm

I can click immediately again to get it to show.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Fri Apr 03, 2009 2:08 pm

I get the same problem that Attan described.

But if I change the condition from 'single clicked' to 'either single or double clicked', it works fine.

Even though the behaviour of single click seems weird in this case, it's probably the intended behaviour. (I can see cases where you'd want to differentiate between a single and a double click on an object... and in that case, you wouldn't want to have both clicks of the double-click also registering as a single click. So it makes sense to have conditions where you look for the input of one click alone, two together, or any click.)
B
5
S
2
G
4
Posts: 113
Reputation: 2,101

Post » Fri Apr 03, 2009 2:18 pm

[quote:1eogqhai]I can click immediately again to get it to show.[/quote:1eogqhai]
That's wierd... another guy had to click three times.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest