Director FAQ || Notes ~ Short Index ~ Full Index ~ Search || Prev ~ Next ||

[13] MIAWs


Director FAQ [13] MIAWs

[13.1] What the hell is a MIAW?

[Many answers in this section are derived from ones by Paul Farry <p.farry@cqu.edu.au>]

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.

[top]


Director FAQ [13] MIAWs

[13.2] Can I use transitions and palettes in a MIAW?

As of version 4.0.4, transitions may now be used properly in a MIAW (ie, a MIAW can execute its own transition without affecting or being affected by the stage). In previous versions this was not the case.

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.)

[top]


Director FAQ [13] MIAWs

[13.3] Can the stage use transitions and palettes with a MIAW running?

Yes. Before 4.0.4 this could be a bit flaky, but now it works fine.

[top]


Director FAQ [13] MIAWs

[13.4] Can a MIAW forget itself?

Yes, providing it knows what it is called or has a global variable pointer to itself :
  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?)

[top]


Director FAQ [13] MIAWs

[13.5] Can I stop the user from closing my MIAW?

Yes. Try putting the following as a movie script in the movie you are opening as a MIAW :

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]

[top]


Director FAQ [13] MIAWs

[13.6] And what else?

A MIAW will receive the following events in response to user interactions. Place handlers for these in movie scripts if you want to act on them :
on activateWindow
  ...
end
is called whenever the movie is brought to the front or clicked on.
on deactivateWindow
  ...
end
is called whenever the movie is sent behind another window, or another window is brought to the front or clicked on.
on closeWindow
  ...
end closeWindow
is called when the window is closed, as mentioned above.

[top]


Director Web: Director FAQ: [13] MIAWs

Maricopa Center for Learning and Instruction (MCLI)
Maricopa County Community College District
HTML by Grant Young, mediac@pobox.com

The Internet Connection at MCLI is Alan Levine --}
Comments to levine@maricopa.edu

URL: http://www.mcli.dist.maricopa.edu/director/faq/faq13.html