lz.IdleService
Idle service.

JavaScript: lz.IdleService
extends lz.Eventable »

lz.Idle is the single instance of the class lz.IdleService.

The OpenLaszlo runtime generates idle events at a fixed, unspecified frequency. Here is a simple example that shows how to receive the onidle event:

<canvas height="80">
   <text name="display"/>
   <attribute name="counter" value="0"/>
   <handler name="onidle" reference="LzIdleService.LzIdle">
     display.format("Received %d idle events", ++counter);
   </handler>
 </canvas>

Class Attributes

Name (CSS property) Type (tag) Type (js) Default Category
LzIdle   lz.IdleService   readonly
  The idle service. Also available as the global lz.Idle.

Methods

callOnIdle()
lz.IdleService.callOnIdle(d : lz.handler);
Calls the given delegate at the next idle event. This can be used for a non-repeating callback.
Parameter Name Type Description
d lz.handler The delegate to be called on the next idle event.

setFrameRate()
lz.IdleService.setFrameRate(fps : Number);
Sets the frame rate (FPS) used for the idle update.
Parameter Name Type Description
fps Number The number of frames per second to use for idle events

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
onidle This is the idle event for the system, sent by this service

Events inherited from lz.Eventable

ondestroy