A movie in a window is any Director movie playing inside an independent operating-system level window (*** Windows? is it at OS level or is it a child of the Director app? ***). MIAWs have a number of behavioural differences from a normal Director movie, especially when running within the Director application rather than a projector, but almost all features of a movie apply to a MIAW.
The most significant difference between a MIAW and the stage movie is that all the Director windows (cast, score, script etc) belong to the stage -- it is not possible to directly edit the contents of a MIAW. The MIAW is always in "playing" mode rather than "editing" mode. A MIAW automatically starts playing as soon as it is opened.
MIAWs can communicate with the stage and each other via global variables (all globals are visible to all movies) and with the tell command :
tell (window "miaw demo") to getStuffed
will have one of two effects. If "miaw demo" has a handler for the getStuffed message, it will execute. If not, it'll crash with an alert (pretty graceful, NOT!) so make sure you only send movies messages they understand.
Among the uses for MIAWs are: dialog boxes, progress bars, toolbars, floating palettes, control panels, debugging utilities and movie-building utilities.
Palettes, however, belong to the stage. Anything in the MIAW's palette channel is ignored, as are puppetPalette commands executed by the MIAW. The MIAW can still instruct the stage to perform a puppetPalette with
tell the stage to puppetPalette "my palette"but the stage and each MIAW has its own cast, so "my palette" must be in the stage movie's cast or the shared.dir file, otherwise the stage will not be able to interpret the command and will halt with a "Palette not defined" error.
(It might be possible to use copyToClipboard and pasteClipboardInto to move a palette castmember from the MIAW cast to the stage cast before the puppetPalette, but I haven't checked this.)
forget (window "debugWind")works just fine even when issued by window "debugWind" itself.
(You can tell I expected this not to work, can't you?)
global myWind -- ideally this needs to be set when the MIAW is opened -- by the stage, though there are various kludges to -- work it out otherwise
on closeWindow open myWind end closeWindow[Thanks to Paul Farry <p.farry@cqu.edu.au> for this suggestion]
on activateWindow ... endis called whenever the movie is brought to the front or clicked on.
on deactivateWindow ... endis called whenever the movie is sent behind another window, or another window is brought to the front or clicked on.
on closeWindow ... end closeWindowis called when the window is closed, as mentioned above.
Maricopa Center for Learning and Instruction (MCLI)
The Internet Connection at MCLI is
Alan Levine --}
Comments to
levine@maricopa.edu
URL: http://www.mcli.dist.maricopa.edu/director/faq/faq13.html