User Guide

318 Chapter 12: Methods
Example
This statement tests whether 3.0 is a floating-point number. The Message window displays the
number 1, indicating that the statement is
TRUE.
put (3.0).floatP
-- 1
This statement tests whether 3 is a floating-point number. The Message window displays the
number 0, indicating that the statement is
FALSE.
put (3).floatP
-- 0
See also
float(), ilk(), integerP(), objectP(), stringP(), symbolP()
flushInputEvents()
Usage
-- Lingo syntax
_player.flushInputEvents()
// JavaScript syntax
_player.flushInputEvents();
Description
Player method; flushes any waiting mouse or keyboard events from the Director message queue.
Generally this is useful when script is in a tight loop and the author wants to make sure any
mouse clicks or keyboard presses don't get through.
This method operates at runtime only and has no effect during authoring.
Parameters
None.
Example
This statement disables mouse and keyboard events while a repeat loop executes:
-- Lingo syntax
repeat with i = 1 to 10000
_player.flushInputEvents()
sprite(1).loc = sprite(1).loc + point(1, 1)
end repeat
// JavaScript syntax
for (var i = 1; i <= 10000; i++) {
_player.flushInputEvents();
sprite(1).loc = sprite(1).loc + point(1, 1);
}
See also
on keyDown, on keyUp, on mouseDown (event handler), on mouseUp (event handler),
Player