BreakWhileMouseOn()
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.
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 ReturnHave 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.