Idle Handler

Date:    Thu, 5 Jan 1995 14:27:15 EST
From:    John Dowdell <71333.42@COMPUSERVE.COM>
Subject: Re: On Idle
Angel Izurieta asks on Jan 4 "how does Director check on Idle ."

You can test this, Angel... have a Movie Script that goes:

  on exitFrame
    put "frame"
    go the frame
  end

  on idle
    put "idle"
  end
This will show you idle execution in the Message Window.

There are three opportunities per frame for an "idle" event to be generated. This will be fired out if nothing else is occuring. You can see from the above that if you do nothing, and if there is no background processing, that you'll usually end up with three idle events per frame. Moving the mouse or having something going on in the background will drop that to one or two "idle" events being generated per frame.

I don't have the full poop on exactly what goes on during the main loop, or what triggers or doesn't trigger an "idle" event... only JT knows, and in his infinite wisdom he has spared us mere mortals from such minutiae. <g> Still, the above quick test can give you a feel for what's going on with "idle" handlers.

One important tip: In 4.0 there is no longer any need to enable an "idle" handler for the whole movie! Put 'em in a Frame Script instead... this lets you localize "idle" tasks, reducing the general load and also allowing more than one such idle handler per movie. Useful!