Name
BreakWhileMouseOn -- break next WhileMouseOn() command (V1.9) / OBSOLETE
Synopsis
BreakWhileMouseOn()
Function
Attention: This function is part of the Hollywood 1.x event library. You should not use it any longer. Please use the functions of the new library from Hollywood 2.0 which is much better.

This function breaks the next WhileMouseOn() command that will be executed. You usually use this function if your ONBUTTONCLICK label shall return immediately to your event loop instead of the WhileMouseOn() command in your ONBUTTONOVER label.

Normally, if you have an ONBUTTONCLICK and an ONBUTTONOVER label, Hollywood will return to your ONBUTTONOVER label after the mouse button was released because the mouse is still over your button after the user clicked the mouse. If you want Hollywood to return to your main event loop after a mouse click, use this command.

Note: This command is only required in rare cases.

Inputs
none

Example
While(quit = FALSE)
   WaitEvent
Wend

Label(ONBUTTONOVER1)
Print("Mouse over button 1")
WhileMouseOn
Print("Mouse no longer over button 1")
Return

Label(ONBUTTONCLICK1)
Print("Mouse click on button 1")
WhileMouseDown
Print("Mouse button released")
BreakWhileMouseOn
Return
Have a look at the above code. The BreakWhileMouseOn() causes Hollywood to return immediately to the WaitEvent() loop. If there was no BreakWhileMouseOn() in the code above, Hollywood would return to the WhileMouseOn() command and wait until the user moves the mouse out of the button area.

Show TOC