STEP 2:

You have to decide what it is you want your double-click to do.

For this example, we will simply "GoTo" the next frame. In frame 1 of the movie, the window is open. In frame 2, the frame is closed.
Now for some programming questions...

What is a double-click? You do it hundreds of times a day on your PC. But it is MUCH more than just the computer testing for two clicks....
It has to test the gap between the first click and release. What if the user clicks and holds?
...and the gap between the second click and release. What if the user double-clicks then holds?
...and the gap between the first release and second click. What if you click and release fast enough... then pause too long... then click and release fast enough again?
...and the gap between the first release and second release. This is the final test. If you click, then release fast enough, then click again fast enough, finally release that second click fast enough...

THEN and ONLY then is it a double-click.

And how fast is fast enough? That's our variable "gap". (Which we added CPUlag to.)
From personal tests I found 350ms (plus CPUlag) seems to work about right.

Here we test for the first click and release being close enough together to pass:


Here we test for the second click and release being close enough together AND the gap between the two releases:


The only real trick is that if a person clicks once, releases, then pauses TOO LONG before clicking again, well then the second measured click is actually a first click. Therefore, instead of going back to frame 1 we switch the second click variables to be first click variables and stay in frame 2.

Note that even though there are two frames here, they do not run consecutively according to the movie's playback head. The only time we move from frame 1 to frame 2 is if the user has clicked the button.