• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Deeper into Lingo > Scripting idle event handlers

Scripting idle event handlers

We've set up scripting that returns the sprites to their original positions every 6 seconds—but is there any way for the end user to know that? Since we're currently exploring the possibilities of user feedback, let's look into providing some sort of countdown, an onscreen visual representation of the time remaining until the cleanUp handler is executed.

To do this, we'll write a handler that uses the idle event, our guarantee that the handler will be executed as often as possible (that is, whenever Director isn't doing something else). We'll put that idle handler in a frame behavior script; it would work just as well in a movie script, but then it would also apply to frames we might later add to the movie. Unless you're absolutely sure that your movie will remain a single-frame production, it's a good idea to keep frame-specific scripts out of the movie script.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint