"http://www.w3.org/TR/html4/loose.dtd"> OS NonLinear
  3D
Dragging
Film Loops
Games
Geometry
Imaging Lingo
LDMs
Navigation
OOP
Scripts
Shockwave
Sound
Sprites
Text
Xtras
Miscellaneous   play done
  FPS meter
  keyDownScript
  Key Manager
  Key Pad
  Scroll Movie
  windowType

This movie demonstrates a technique which uses 'play the frame' followed (some time later) by 'play done' to convert an asynchronous process into a synchronous call. The use of 'play' means that the movie can continue to animate and execute Lingo. The progress bar, for example, is animated on stepFrame while the asynchronous process is executing.

'Play ...' and 'play done' should be used with caution. Unbalanced use can lead to memory becoming locked. In certain situations, calling 'play done' can crash the Director player. In other situations 'play...' may be treated as a plain 'go...' command, and in yet others, 'play done' is silently ignored.

  • Calling 'play ...' in a handler stack initiated by an xtra can crash Director
  • Calling 'play done' from a stepFrame handler can crash Director
  • Modifying a property of a timeOut object before calling 'play ...' can crash Director, even if the modification occurs in a different handler. (Changing the timeOut property in a handler called by the mouseUpScript can cause a crash if you call 'play ...' in the subsequent mouseUp() handler.
  • Calling 'play ...' from an endSprite handler called by navigating to a different frame may cause a seemingly unrelated error to occur when 'play done' is called
  • If any timeOut objects have an object as their target, then all code following the 'play ...' command will be executed as if 'play' had been 'go'.
  • Calling 'play ...' via a sendSprite or sendAllSprites call will make 'play done' fail silently
  • Using call() on a sprite's scriptInstance list will make 'play done' behave correctly, up to the point where call() was used. From that point on, the Lingo playback head will never complete execution of the handler stack, which will continue to consume RAM indefinitely.
This fully-commented demo movie aspires to avoid all these pitfalls.

Source:
Macintosh
Windows