User Guide
804 Chapter 14: Properties
idleHandlerPeriod
Usage
-- Lingo syntax
_movie.idleHandlerPeriod
// JavaScript syntax
_movie.idleHandlerPeriod;
Description
Movie property; determines the maximum number of ticks that passes until the movie sends an
idle message. Read/write.
The default value is 1, which tells the movie to send
idle handler messages no more than 60
times per second.
When the playhead enters a frame, Director starts a timer, repaints the appropriate sprites on the
Stage, and issues an
enterFrame event. Then, if the amount of time set for the tempo has elapsed,
Director generates an
exitFrame event and goes to the next specified frame; if the amount of
time set for this frame hasn’t elapsed, Director waits until the time runs out and periodically
generates an
idle message. The amount of time between idle events is determined by
idleHandlerPeriod.
Possible settings for
idleHandlerPeriod are:
• 0—As many idle events as possible
• 1—Up to 60 per second
• 2—Up to 30 per second
• 3—Up to 20 per second
• n—Up to 60/n per second
The number of
idle events per frame also depends on the frame rate of the movie and other
activity, including whether scripts are executing. If the tempo is 60 frames per second (fps) and
the
idleHandlerPeriod value is 1, one idle event per frame occurs. If the tempo is 20 fps, three
idle events per frame occur. Idle time results when Director doesn’t have a current task to
perform and cannot generate any events.
In contrast, if the
idleHandlerPeriod property is set to 0 and the tempo is very low, thousands
of
idle events can be generated.
The default value for this property is 1.
Example
The following statement causes the movie to send an idle message a maximum of once
per second:
-- Lingo syntax
_movie.idleHandlerPeriod = 60
// JavaScript syntax
_movie.idleHandlerPeriod = 60;
See also
on idle, idleLoadMode, idleLoadPeriod, idleLoadTag, idleReadChunkSize, Movie