Main Page About Ldoc+ Error Lists Main Index Index Groups

Ldoc+ Lingo Group:
    MIAWs & THE STAGE

 info D5/601:
      window (keyword)
      stage (keyword)
 6    0 elements new in Director 6.0, nothing changed!
  !  16 contain Dictionary fixes 601 & 501,
   +  6 miss from the 'Appendix' 6.0 for MIAWs.


Window & Stage Commands (5):
  !   close       window (takes URLs)
  !   forget      window (takes URLs) (no 'forget the Stage')
      open        window (takes URLs)
  !   moveToBack  window
  !   moveToFront window

Properties of Windows & of the Stage (10):
  !   drawRect     of window
      rect         of window
   +  sourceRect   of window
      fileName     of window (takes URLs)
      modal        of window
      name         of window
      title        of window
      titleVisible of window
      visible      of window
  !   windowType   of window

Window & Stage Functions (6):
  !   activeWindow
   +  frontWindow
  !+  the stage
  !   tell...to
      window nameOrNumber
  !   windowList            (not the Stage)
      windowPresent("name") (not the Stage)

Window Event Handlers (not to Stage) (7):
      on activateWindow
      on closeWindow (also to Stage when 'close the Stage')
   +  on deActivateWindow
      on moveWindow
      on openWindow  (also to Stage when 'open the Stage')
  !   on resizeWindow
  !   on zoomWindow

Stage Properties (10):
  !   centerStage
  !   deskTopRectList
  !   fixStageSize
  !+  rect of the stage
  !+  stage (info)
  !   stageColor
      stageBottom
      stageLeft
      stageRight
      stageTop





[index] _ D5/601 _ 971208:


activeWindow

movie window system property

6.0 Dictionary Errors, partly the same in 5.0:

"...indicates which movie window is currently active."
= Should read:
"...identifies the 'window' that the movie testing this property
    is currently playing in."

"For the main movie, the 'activeWindow' is the Stage."
= Should read:
"For the main movie, the 'activeWindow' returns '(the stage)',
 if you haven't changed the 'name of the stage'."

"For a movie in a window, the 'activeWindow' is
 the movie in a window itself."
= Should read:
"For a movie-in-a-window (MIAW), the 'activeWindow' returns
 the windowObject expression of the window the movie is playing in,
 in the form of 'window "name"'."

...'activeWindow' is NOT "the movie itself" or its name. When
   the movie's name IS the 'name of window' then it will be part of
   the windowObject expression: '(window "C:\MYMOVIE")'

= Missing:
  The activeWindow property can be tested but NOT set.
  There's NO mentioning of this thing in the 'Learning Lingo'!

"set windowCount = count(the windowlist) into windowCount"
= The Example should read:
"set windowCount = count(the windowList)"

"set the title of (getAt(the windowlist, x)) to..."
= The Example should read:
"set the title of window x to..."

...you can identify a 'window' by its number, which is equivalent
   to its position in 'the windowList': 'forget window 1'.

"See Also: on activeWindow"
= Should read:
"See Also: on activateWindow, the frontWindow, the name of window"
 --

From the '601 ReadMe':
  Fixed potential crash when doing 'forget window the activeWindow'
  in a MIAW in any handler other than 'on closeWindow'.
  --

1. TIP: The 'activeWindow' will return the windowObject expression for the window that the movie which tests this system property is currently playing in, in the form of '(window "thisWindowName")'. It will NOT just return the 'fileName of window', instead the 'name of window' (which can be tested and set by Lingo separately) will be part of the windowObject expression. If a movie-in-a-window executes a 'go to movie...', the new movie will still be playing in the same windowObject and will not change that window's name. In this case, 'the activeWindow' still returns the same windowObject, and not the new movie's name. Actually a 'name of window' set by the programmer might not have anything to do with a movie name at all, like in: 'set x = window "Help Needed?". Really took me some time to figure out the meaning of this little thing... :-(

2. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971212:


centerStage

main Stage display property

"Place the statement...in the movie that preceeds the movie..."
= Missing:
"...or in the LINGO.INI file together with your projector."

= Missing:
"See Also: ... the deskTopRectList, the rect of the stage"
 --

= Missing from the Dictionaries 4.0 - 6.0:
  The 'centerStage' property is disabled for movies playing
  in a window or in a browser.
  --

TIP: It's a good habit to have the line 'set the centerStage = TRUE' in the LINGO.INI file for every projector that wants to be displayed in the center of the monitor (also put a 'cursor 4' line into the LINGO.INI to keep the system's watch cursor up until your movie starts playing; best to ALWAYS have a LINGO.INI accompanying the projector).






[index] _ D5/601 _ 971208:


close window

movie window hiding command

6.0 Dictionary Errors, partly the same in 5.0:

"Syntax:  close window windowIdentifier"
= Missing:
  The windowIdentifier' can also be a 'name of window' set by Lingo,
  which does NOT have to be a movie name at all; see 'open window'.
  A 'windowIdentifier' can also be stored in a (global) variable
  to be used as a shortcut: 'close gMyWindowName'.

"Use the complete pathname..."
= Missing:
  Enclose '(the pathName & aMovieNameWithoutExtension)'
  with parenthesis; see the Dictionary on '()' parenthesis.

= Missing:
  A closed window (or its sound) is still playing and in RAM,
  though not visible, until it's deleted with 'forget window'.
  Using the 'close window' command sends a 'closeWindow' event,
  and an 'on closeWindow' handler in the movie's script is a
  good place to stop its sound etc. before deleting its window.
  --

1. TIP: Do NOT explicitly code the movie name for a 'window' command with its extension ".DIR", which will change to ".DXR" or ".DCR" after protection/afterburning. Director looks for the adequate file if you just supply its name (without extension). In 6.0, the 'close window' command accepts URLs.

2. TIP: The command 'close window windowNameOrNumber' or 'close myWindowObjectVariable' only hides the movie-in-a-window (MIAW) from the screen, but does NOT delete it from RAM or from Lingo's system property 'the windowList'. Testing 'windowPresent(justTheWindowNameString)' for the 'closed' window will report TRUE. The 'close window' command is identical to setting the 'visible of window' to FALSE, or to the user clicking the close button of the window. They all trigger an 'on closeWindow' handler in the movieScript of that movie. But they all do NOT call its 'on stopMovie' handler, which is only activated when the movie itself stops, or jumps to another movie that will play in that same 'window'. While a MIAW is closed (hidden), it continues to play animations, sounds, and transitions, unless you make it stop all of that in its 'on closeWindow' event handler. In 4.0/5.0, you can use the 'pause' and 'continue' commands to achieve that (outdated in 6.0). In 6.0, you have to design a special frame to jump to when the 'window' is closed/deactivated. Lateron use 'forget window' to totally delete the MIAW from RAM and from 'the windowList'.

3. TIP: Lingo doesn't care if you repeatedly 'close' a window when it's already closed (the same with 'open window' for already-opened windows, but possibly this brings the 'window' to the front).

4. TIP: The 'stage' is a 'window' itself, and you can make 'the stage' invisible by using 'close the stage'; use 'open the stage' to get it back in front of all other windows, or set the 'visible of the stage' FALSE or TRUE (I think not on Win31). In these cases, 'on closeWindow' and 'on openWindow' handlers in the movieScript of the movie playing in the main stage window are also called, which normally doesn't happen.

5. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971210:


deskTopRectList

monitor settings property

6.0 Dictionary Error, same in 5.0:

"return count(deskTopRectList)"
= Example 2 should read:
"return count(THE deskTopRectList)"

= Missing:
"See Also: rect of the stage, drawRect of the stage,
 the stageBottom, the stageLeft, the stageRight, the stageTop,
 the centerStage, the fixStageSize"
 --

TIP: See also 'rect of the stage'.






[index] _ D5/601 _ 971208:


drawRect of window

movie window display property

6.0 Dictionary Errors, partly the same in 5.0:

"...identifies the rectangular coordinates
 of the section of the movie..."
= Should read:
"...identifies the rectangular coordinates of the section
 of the WINDOW that the movie will fit or rescale itself into."

...the 'drawRect of window' starts with (0,0) at the left top
   corner of the WINDOW, not of the stage or the screen!

"However, text in strings doesn't rescale
 when a this property is changed."
= Should read:
"However, text and sizes of FIELDS and BUTTONS on the movie's
 stage do NOT rescale when this property is changed."
...possibly more elements don't rescale, like videos, film loops etc.

= Missing:
  If the 'drawRect of window' is smaller than the 'window' itself,
  the rest of the window area will show 'the stageColor' of the movie
  in that window. If 'drawRect' is bigger than the 'rect of window',
  the overspilling parts of the movie won't be visible.
  Playing a rescaled movie is VERY time-consuming!

"The portion of the movie within the rect
 is the part of the movie..."
= The Example should read:
"The rect defines the area of the 'window'
 that the movie will rescale itself into."

= "See Also" should mention:
   rect of window
...which starts with (0,0) at the left top corner of the screen.
   --

TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971210:


fixStageSize

movie display property

6.0 Dictionary Errors, same in 5.0:

"This property is primarily used for movies played back
 with the player."
= Should read:
"This property only works for movies playing in a projector."

"...sends the playback head to a specified frame if it is.
    if the fixStageSize = FALSE then go..."
= The Example should read:
"...sends the playback head to a specified frame if it is NOT: ..."

= Missing:
"See Also: ... rect of the stage, drawRect of the stage,
 the stageBottom, the stageLeft, the stageRight, the stageTop,
 the deskTopRectList, the fixStageSize"
 --

TIP: See also 'rect of the stage'.






[index] _ D5/601 _ 971208:


forget window

MIAW deleting command

From the '601 ReadMe':
  Accepts a URL as file name.
  Fixed potential crash when doing 'forget window the activeWindow'
  in a MIAW in any handler other than 'on closeWindow'.
  --

1. TIP: The 'forget window windowNameOrNumber' or 'forget myWindowObjectVariable' command will totally delete a movie-in-a-window (MIAW) from screen, from RAM, and from Lingo's system property 'the windowList'. But it will NOT call the 'on stopMovie', 'on closeWindow', or 'on deActivateWindow' event handlers in a movieScript of the movie in that window. If a sound is playing in a MIAW when it's deleted, the sound continues to play until another movie occupies that sound channel or stops the sound. If you want the movie's 'on closeWindow' event handler to be executed first, 'close' the window or set its 'visible of window' to FALSE before 'forgetting' it.

2. TIP: You CANNOT 'forget' a MIAW that is refered to by multiple (global) variables, the 'forget window' command will just be ignored! But if you 'set the windowList = [ ]', all windows will be immediately 'forgotten', unless there's a copy of that windowObject in some variable of yours!

3. TIP: If you intend to use a MIAW again at some point later on during your project, do NOT 'forget' it, unless you need the memory freed up. Use 'close window' or set its 'visible' to FALSE to have the MIAW disappear from the screen, and to have it handy for reuse at anytime. Lingo doesn't care if you repeatedly 'close' a window when it's already closed (the same with 'open window' for already-opened windows, but possibly this brings the 'window' to the front).

4. TIP: Test 'windowPresent(justTheWindowNameString)' to see if your windowObject exists BEFORE attempting to do something with it, and even before bringing it onto the screen; a return value of FALSE means that your tested 'window' does not exist (yet or anymore). If you issue a 'forget window "xyz" ' for a MIAW that doesn't exist, you will get an 'Open File' dialog box, asking you 'Where is "xyz"?'. For a non-existing window number, you'll get an alert 'Script error: Window not found'.

5. TIP: There have been problem reports on deleted MIAW's still appearing on the stage during transitions. A workaround seems to be a forced stage redraw with 'set the stageColor = the stageColor' or 'tell the stage to set the stageColor = the stageColor' after forgetting a MIAW.

6. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971208:


modal of window

MIAW interactivity property

1. TIP: The default setting for the 'modal of window' is FALSE, regardless of the assigned 'windowType' for the MIAW (type -1 by default). In the Dictionary's entry on 'windowType of window', the types 1 and 5 are 'modal', but type 5 doesn't work (at least on Macintosh). And using the windowType 1 does NOT change the value for the 'modal of window' to TRUE.

2. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971208:


moveToBack/moveToFront window

movie window system commands

6.0 Dictionary Error, same in 5.0:

"set myWind=getAt(the windowList,1)
 moveToBack myWind"
= The Example should just read:
"moveToBack window 1"
...you can identify a 'window' by its number, which is equivalent
   to its position in 'the windowList'.
...but please do moveToBack your wind... ;-)
   --

1. TIP: Using the 'moveToBack/moveToFront window windowNameOrNumber' or 'moveToBack/moveToFront myWindowObjectVariable' commands for a movie-in-a-window (MIAW) will activate the event handlers 'on deActivateWindow' or 'on activateWindow', if they are located in a movieScript of the movie playing in that 'window'. If you use the 'tell...to' command to send such a message to a window, you don't need to specify the window twice for the 'moveToBack/moveToFront' command: 'tell window gMyWindow to moveToBack'. You can also send these commands to 'the stage', but without calling those event handlers in the main movie; if needed, call them with Lingo yourself.

2. TIP: Test 'the frontWindow' to see which window is in front. If the stage itself is frontmost, 'the frontWindow' returns FALSE; if a media editor, a floating palette, or the Message Window is frontmost (during authoring), the result will be '<void>'. Test 'the activeWindow' to see which 'window' the current movie is playing in.

3. TIP: The 'pause' command (outdated in 6.0) is handy for a movie-in-a-window (MIAW): Use it in its 'on deActivateWindow' handler in the movieScript to have the movie pause when it receives a 'moveToBack', and have a 'continue' command (outdated in 6.0) in its 'on activateWindow' handler to carry on playing when it gets a 'moveToFront'. In 6.0, you have to design special frames to jump to when the 'window' is de/activated.

4. TIP: On Windows, it's a known problem that the Stage doesn't always get key presses passed from the System, especially on start-up. To direct all key messages to the Stage, like to an editable field, put a 'moveToFront the stage' in your 'on prepareFrame' handler in a movie script (not possible in Shockwave). Or when using multiple movie windows, have the frontmost MIAW 'tell the stage to...' do something when it catches a key press.

5. TIP: Picture this: I added an 'on activateWindow' event handler with an 'alert("activated!")' in the movieScript of a movie that was playing in a 'window', and when I sent it a 'moveToFront', I got an endless repeat loop of alerts. So I was thinking that 'on activateWindow' handlers are dangerous, and was making up a tip not to use 'em. Gretchen's short explanation: "Canceling the alert sends another activate window". What a brain... :-)

6. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971208:


on resizeWindow

MIAW sizing event handler

6.0 Dictionary Errors, same in 5.0:

"on resizeWindow centerPlace
   set the loc of sprite 3 to centerPlace
 end"
= The Example should read:
"on resizeWindow
   global gCenterPlace
   set the loc of sprite 3 to gCenterPlace
 end"

...NONE of Director's event handlers gets any arguments passed in.
   Where should this event handler get the 'centerPlace' value from
   when the user resizes the window and the event is sent automatically?

= Missing:
  The 'resizeWindow' event is NOT sent if Lingo sets the
  'drawRect of window' or 'rect of window'. This applies to
  'moveWindow' and 'zoomWindow' events as well, whereas the
  four other window events are also triggered by the corresponding
  Lingo window commands, i.e. 'moveToFront window' triggers an
  'activateWindow' event.
  --

1. TIP: From Gretchen's 501 BugList: Resizeable MIAW's display a resize box now in the corner, but if you do this: 'on resizeWindow .. updateStage .. end' The resize box disappears. (Mac)
Gretchen's page at www.updatestage.com/idlt07.html shows a nice table with all the 'window' messages and their corresponding user actions and Lingo commands (except 'on openWindow' is missing <g>).

2. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971208:


on zoomWindow

MIAW zooming event handler

6.0 Dictionary Errors, same in 5.0:

"on zoomWindow centerPlace
   set the loc of sprite 3 to centerPlace
 end"
= The Example should read:
"on zoomWindow
   global gCenterPlace
   set the loc of sprite 3 to gCenterPlace
 end"

...NONE of Director's event handlers gets any arguments passed in.
   Where should this event handler get the 'centerPlace' value from
   when the user zoomes the window and the event is sent automatically?

= Missing:
  The 'zoomWindow' event is NOT sent if Lingo sets the
  'drawRect of window' or 'rect of window'. This applies to
  'moveWindow' and 'resizeWindow' events as well, whereas the
  four other window events are also triggered by the corresponding
  Lingo window commands, i.e. 'moveToBack window' triggers an
  'deActivateWindow' event.
  --

TIP: See 'on resizeWindow'; and 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971208:


open window

MIAW creating and/or displaying command

1. TIP: To open a new movie-in-a-window (MIAW), you should first create a windowObject into a (global) variable by using: 'global gMyWindow .. set gMyWindow = window (the pathName & aMovieNameWithoutExtension)'. Or 'set gMyWindow = window "anyNameYouLike" ', and then following 'set the fileName of gMyWindow = (the pathName & aMovieNameWithoutExtension)'. This will already add the new windowObject (child of the stage parent window) into Lingo's system property 'the windowList'. The MIAW itself is not yet visible at this point, so you can easily set some of its 'window' properties like 'the drawRect/fileName/modal/name/rect/ title/titleVisible/visible/windowType of gMyWindow'. Finally make the MIAW visible in front of the stage by using 'open gMyWindow', or 'moveToFront gMyWindow', or 'set the visible of gMyWindow = TRUE'.

2. TIP: You CANNOT open a MIAW that has no fileName assigned to it. If needed, preLoad the movie before opening its window. You can also place its 'rect of window' somewhere far off-screen, to have it ready before showing it on the screen. In 6.0, the 'open window' command accepts URLs.

3. TIP: If you open a movie in a 'window', its 'on startMovie' handler will NOT be called (only if a movie jumps to it, which already plays in a window), instead its 'on openWindow' handler will be triggered (everytime you issue 'open window' for it). If needed, set a global flag variable to have its 'on openWindow' handler call its 'on startMovie' the first time for basic initialization.

4. TIP: Open all MIAW's from the main 'stage' movie. If a MIAW is supposed to open another MIAW, have it 'tell the stage to open...' it. In 256 color mode, the stage sets and dominates the color palette for all MIAW's. Possibly set your movies that will play in a 'window' to the option 'Remap Palettes When Needed' (time-consuming). On Windows-PCs, MIAW's are only visible in the area of the stage, unless you use a full screen projector.

5. TIP: Note: Like all 'window' commands, 'open window' only accepts ONE argument. If you want to open a movie straight away in the window, then add 'the pathName' to the movie's name and surround the expression with parenthesis: 'open window (the pathName & aMovieNameWithoutExtension)'. Do NOT explicitly code the movie name for a 'window' command with its extension (".DIR"), which will change after protection.

6. TIP: Gretchen's 601 BugList: "On Win95 or NT you cannot open two MIAW's with the same filename without the dread 'File in use' alert." Gretchen's 501 BugList: "If you create an MIAW offstage and resize its rect before making it visible, garbage sometimes appears in the bottom half inch of the MIAW when you make it visible. Doing the following in the frame after making it visible is a workaround: set the stagecolor to the stagecolor". She also mentions that if you open a MIAW that shares a linked external castLib with another movie, and that shared castLib contains a film loop comprised of members in the other movie's INTERNAL cast, you get an error dialog (she tested Macintosh).

7. TIP: On Macintosh as well as on Windows, you can make 'the stage' immediately invisible by using 'close the stage'; use 'open the stage' to get it back in front of all other windows. On Macintosh only, you can set 'the visible of the stage'. In these cases, 'on openWindow' or 'on closeWindow' handlers in the movieScript of the movie playing in the main stage window are also called, which normally doesn't happen.

8. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971210:


stage

main movie window object

= Missing from the Dictionaries 4.0 - 6.0:
  The Stage has ALL of the 10 window properties:
  the drawRect     of the stage
  the fileName     of the stage
  the modal        of the stage
  the name         of the stage
  the rect         of the stage
  the sourceRect   of the stage
  the title        of the stage
  the titleVisible of the stage
  the visible      of the stage
  the windowType   of the stage

  The Stage gets NONE of the 7 window events,
  except 'closeWindow' on 'close the stage',
  and 'openWindow' on 'open the stage'.

  4 of the 5 window commands can be used with the Stage:
  close       the stage
  open        the stage
  moveToBack  the stage
  moveToFront the stage

"See Also: the stageBottom, the stageLeft,
 the stageRight, the stageTop, the centerStage, 
 the deskTopRectList, the fixStageSize, tell...to, window"
 --

1. TIP: In Director 1.0 to 601, you CANNOT use all possible stage sizes (in 6.0: Movie Properties dialog box): The width of the stage must be a number that can be divided by 16, otherwise it will automatically jump to the closest, lower number that's divisible by 16. Especially take this into consideration when designing for Shockwave.

2. TIP: You can test AND set 'the drawRect of the stage', which scales and relocates all bitmaps in the score to a portion of the stage size.

3. TIP: You can test but NOT set 'the fileName of the stage'...

4. TIP: You can test AND set 'the name of the stage' (at least on Macintosh). If you do so, then instead of '(the stage)', 'the activeWindow' will return that new name: '(window "yourStageNamequot;)', but will also test TRUE on 'the activeWindow = the stage'. This can come in handy when dealing with a bunch of MIAW's at the same time.

5. TIP: You can test but NOT set 'the rect of the stage'. It returns a rectangle with the position of the Stage relative to the left top corner of the current monitor resolution (0,0), like: 'rect(80, 60, 720, 540)'. You can test but NOT set the 4 values of the stage's rectangle by using 'the left/top/right/bottom of the rect of the stage', which equals 'the stageLeft' etc. You can also test but NOT set the 'the height/width of the rect of the stage', which sometimes comes quite handy.

6. TIP: You can test but NOT set 'the sourceRect of the stage', which returns the original stage coordinates (the stage size) of the active movie. The 'sourceRect of window' property comes in handy when adjusting different sized movies to a fixed-sized Stage or child window.

7. TIP: You can test AND set 'the titleVisible of the stage', but changes will not be visible.

8. TIP: You can test and set 'the windowType of the stage', but changes will not be visible.

9. TIP: You can use 'close the stage' to hide the Stage and make it disappear; use 'open the stage' to get it back in front of all other windows; the main movie on the Stage will then receive 'closeWindow' and 'openWindow' events.

10. TIP: You can use 'moveToBack the stage' and 'moveToFront the stage' to bring the main stage 'window' behind or in front of other MIAW's, but the main movie on the Stage will NOT receive 'deActivateWindow' or 'activateWindow' events.

11. TIP: On Macintosh (and on Win95 in 601?), you can make 'the stage' invisible with 'set the visible of the stage = FALSE', and no stage update or puppet is needed for immediate effect... ;-). Get it back in front of all other windows with 'set the visible of the stage = TRUE', same as 'moveToFront(the stage)', or 'open the stage'.

12. TIP: Normally, NONE of the 7 window events are sent to the main Stage window, except 'closeWindow' when using 'close the Stage', and 'openWindow' when using 'open the Stage'.

13. TIP: If you wanted, you could make copies of the stage: 'set x = the stage'.

14. TIP: As the Stage is normally NOT in 'the windowList' (only child windows are), you could add the main window in with 'add(the windowList, the stage). Why? Hmm...

15. TIP: On Windows, it's a known problem that the Stage doesn't always get key presses passed from the System, especially on start-up. To direct all key messages to the Stage, like to an editable field, put a 'moveToFront the stage' in your 'on prepareFrame' handler in a movie script (not possible in Shockwave). Or when using multiple movie windows, have the frontmost MIAW 'tell the stage to...' do something when it catches a key press.

16. TIP: On Windows, movies-in-a-window (MIAWs) are only visible in the area of the stage, unless you use a full screen projector.

--

EXAMPLEs:

put the stage
-- (the stage)
put value(the stage)
-- (the stage)

put objectP(the stage)
-- 1
put ilk(the stage, #window)
-- 0
put ilk(the stage)
-- #window
put ilk(the stage) = #window
-- 1
put the windowList
-- [ ]
put the activeWindow
-- (the stage)
put the activeWindow = the stage
-- 1

--> Because Director's Message window is open:
put the frontWindow
-- Void

put the fileName of the stage
-- ""
set the fileName of the stage = "Denis"
put the fileName of the stage
-- ""

put the name of the stage
-- 0
set the name of the stage = "Denis"
put the name of the stage
-- "Denis"
put value(the stage)
-- (window "Denis")

put the windowList
-- [ ]
add(the windowList, the stage)
put the windowList
-- [(window "Denis")]

put the modal of the stage
-- 0
set the modal of the stage = TRUE
put the modal of the stage
-- 0

put the title of the stage
-- ""
set the title of the stage = "Denis"
put the title of the stage
-- "Denis"

put the titleVisible of the stage
-- 1
set the titleVisible of the stage = FALSE
put the titleVisible of the stage
-- 0

put the windowType of the stage
-- -1
set the windowType of the stage = 8
put the windowType of the stage
-- 8

put the visible of the stage
-- 1
set the visible of the stage = FALSE
--
--> On Mac (and Win95 in 601?), the stage is now hidden:
--
put the visible of the stage
-- 0

--> This will get your stage back
--> in front of all other windows:
--
open(the stage)
moveToFront(the stage)
--
put (the visible of the stage)
-- 1

--> A movie stage of 640x480 on a 14-inch screen:
--
put the rect of the stage
-- rect(0, 0, 640, 480)
put the width  of the rect of the stage
-- 640
put the height of the rect of the stage
-- 480

--> The same movie, centered on a 800x600 screen:
--
set x = the rect of the stage
put x
-- rect(80, 60, 720, 540)
--
put the left  of x
-- 80
put the right of x
-- 720
put the stageTop
-- 60
put the stageBottom
-- 540
put the width  of x
-- 640
put the height of x
-- 480

put offset(the rect of the stage, -the stageLeft, -the stageTop)
-- rect(0, 0, 640, 480)


put the rect of the stage
-- rect(80, 60, 720, 540)
put the sourceRect of the stage
-- rect(80, 60, 720, 540)
put the drawrect of the stage
-- rect(0, 0, 640, 480)

set the drawrect of the stage = rect(0, 0, 320, 240)
put the drawrect of the stage
-- rect(0, 0, 320, 240)

--> ...and nice looking, too... ;-)
--> Now play around with fitting 4 scores onto the stage
--> at the same time and then creating a zoom-in effect...
--> But the original stage area persists in the background color:

put the rect of the stage
-- rect(80, 60, 720, 540)





[index] _ D5/601 _ 971208:


stageColor

movie and monitor background color property

6.0 Dictionary Errors, partly the same in 5.0:

"...choosing the Stage color from the pop-up palette
 in the panel window."
= Should read:
"...choosing the Stage color from the pop-up palette
 in the Movie Properties dialog box."

"set oldColor = the stageColor into oldColor"
= The Example should read:
"set oldColor = the stageColor"

= Missing from the Dictionaries 4.0 - 6.0:
  The 'stageColor' property can be tested and set,
  and its default value is 0 (for a white background color).
  The 'stageColor' also determines the screen color around a
  movie playing in a full-screen projector on a bigger monitor.
  Using 'set the stageColor = the stageColor' forces a stage redraw
  which also wipes away trails from sprites, videos, or MIAW's.
  --

1. TIP: To get the stage updated without using 'updateStage' or 'go to the frame' command, you can 'set the stageColor = the stageColor' (in a MIAW: 'tell the stage to set the stageColor = the stageColor'). This is also useful for removing 'trails of sprite' ro videos, or leftover parts after a 'forget window' for a movie-in-a-window (MIAW). And it will NOT trigger a 'stepFrame' event.

2. TIP: Remember: Each single movie of your project has its own stageColor setting in the 'Movie Properties' dialog box (in Director 4, the 'Stage Color Chip' was part of the Control Panel Window). This will also be the color around your stage on higher monitor resolutions if you use the projector setting 'Full Screen'; be sure to have the same 'stageColor' throughout your project to avoid color changes around your movies.

3. TIP: To change background colors only in the stage area, use a colored filled shape in a low sprite channel that has the same size as your stage, and change its color dynamically (problem with shapes in 16-bit at 'foreColor of sprite'). It seems best to even use a colored bitmap for that purpose.






[index] _ D5/601 _ 971208:


tell...to

MIAW messaging command

6.0 Dictionary Errors, partly the same in 5.0:

"Syntax:  tell object to statement(s)"
= Only ONE statement possible on one line; should read:
"Syntax:  tell object to statement"

...Prefer to NOT have one MIAW 'tell' another MIAW,
   instead let window1 'tell the stage to tell window2 to...'

"...by sending a value back to the movie."
= Should read:
"...by RETURNING a value back to the movie,
    which can then be tested in 'the result'."

...Another way is to put the value or some text into a global
   variable (or even a text field), which can be read by
   'the stage' and other MIAW's as well.

"...identifies the window by using the full pathname
    or its number in 'the windowList'."
= Should read:
"...identifies the window by using its NAME, or its number,
    which is its position in 'the windowList'."

"...it's a good idea to store the full pathname
    as a global variable"
= Should read:
"...it's a good idea to store the complete windowObject expression
    in a global variable, like: 'set gWindow1 = window "aName"."

"This statement causes the window 'Control Panel' to instruct
 the movie 'Simulation' to branch to another frame.."
= The Example should read:
"This statement causes the window 'Simulation' to go to another frame.."
 --






[index] _ D5/601 _ 971208:


titleVisible of window

MIAW display property

1. TIP: The default setting for the 'titleVisible of window' seems to be TRUE, regardless of the assigned 'windowType' for the MIAW (type -1 by default). Gretchen's page www.updatestage.com/idlt06.html has a nice graphical list of cross-platform windoid types: She lists functioning window types of -1, 0, 1, 2, 3, 4, 8, 12, and 16. From these it seems that only the three types 1 ('Alert'), 2 ('Plain') and 3 ('Plain with shadow') do NOT show the title of the MIAW, although this doesn't seem to be reflected by the default value of the 'titleVisible of window'. In this case, the Dictionary's example would not be very helpful...

2. TIP: If you don't explicitly assign a nice name to a MIAW, and use a windoid that displays a title bar, the movie's name (and pathname, if you specified it) will display at the top of that 'window', as long as 'the titleVisible' is TRUE. Not very interesting for the user...

3. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 970806:


window

windowObject keyword

General Info & Examples:

1. TIP: All window commands are disabled in Shockwave, no MIAW's can play in a browser.

2. TIP: To open a new movie-in-a-window (MIAW), you should first create a windowObject into a (global) variable by using: 'global gMyWindow .. set gMyWindow = window (the pathName & aMovieNameWithoutExtension)'. Or 'set gMyWindow = window "anyNameYouLike" ', and then following 'set the fileName of gMyWindow = (the pathName & aMovieNameWithoutExtension)'. This will already add the new windowObject (child of the stage parent window) into Lingo's system property 'the windowList'. The MIAW itself is not yet visible at this point, so you can easily set some of its 'window' properties like 'the drawRect/fileName/modal/name/rect/ title/titleVisible/visible/windowType of gMyWindow'. Finally make the MIAW visible in front of the stage by using 'open gMyWindow', or 'moveToFront gMyWindow', or 'set the visible of gMyWindow = TRUE'. Later on you can hide the MIAW from the screen with 'close gMyWindow' and again display it with 'open gMyWindow'.

3. TIP: A created MIAW is a windowObject in the form of '(window "aStringName")', which can be stored as a variable, i.e. 'gMyWindow'. In General, a MIAW can be refered to by an expression containig the keyword 'window' together with a 'windowIdentifier', which can be: a) the 'name of window', which can be the movie's full movie and pathName, or you can set any name yourself; b) the integer position of the 'window' in Lingo's own linear list property 'the windowList'. Remember: You can use the 'string()' function to convert a windowObject into a string, if you wanted to access the second word in the windowObject expression: 'put string(window 1) -- "(window "Festplatte:Denis:Lingo:MAIN2")" '. If you use a 'window' command (except 'tell...to') on something that is not a windowObject, you'll get an alert 'Script error: Handler not found!'.

4. TIP: Open all MIAW's from the main movie. If a MIAW is supposed to open another MIAW, have it 'tell the stage to open...' it. Also prefer to not have one MIAW 'tell' another MIAW, instead have windowObject1 'tell the stage to tell windowObject2 to...'. In 256 color mode, the stage sets and owns the color palette for all MIAW's, which in general CANNOT use any transitions or the 'puppetTransiton' command. Possibly set your movies that will play in a 'window' to the option 'Remap Palettes When Needed' (time-consuming). The stage also sets the tempo, but MIAW's can use 'puppetTempo'. On Windows-PCs, MIAW's are only visible in the area of the stage, unless you use a full screen projector. See more in Macromedia's TechNote #3154 'Working with a Movie in a Window (MIAW)'.

5. TIP: Test 'windowPresent(justTheWindowNameString)' to see if your windowObject exists BEFORE attempting to do something with it, and even before bringing it onto the screen; a return value of FALSE means that your tested 'window' does not exist (yet or anymore). If you issue something like 'close window "xyz" ' for a MIAW that doesn't exist, you will get an 'Open File' dialog box, asking you 'Where is "xyz"?'. For a non-existing window number, you'll get an alert 'Script error: Window not found'.

6. TIP: Use 'count(the windowList)' to retrieve the number of existing windowObjects, the last entry is the MIAW you created last. Test 'the frontWindow' to see which window is in front. If the stage itself is frontmost, 'the frontWindow' returns FALSE; if a media editor, a floating palette, or the Message Window is frontmost (during authoring), the result will be '<void>'. Test 'the activeWindow' to see which 'window' the current movie is playing in.

7. TIP: Warning: If you ask Director about a non-existing windowObject, it's automatically generated: If you test 'getPos(the windowList, windowObject)' or even 'objectP(windowObject)' for a 'window' that does NOT exist, that windowObject will automatically be CREATED and added to Lingo's system property 'the windowList', even if you test it on a true copy of 'the windowList'! That's why the 'windowPresent()' function only accepts a string name, and not a windowObject.

8. TIP: You can give any 'window' (also 'the stage') a string name of your choice to make things more easier to handle: 'set the name of gMyWindow = "anyNameYouLike" ', and 'the windowList' will reflect any name changes.

9. TIP: A 'window' can be identified by its position in 'the windowList', as long as there is a window at the specified position: 'close window 1', 'forget window count(the windowList)'.

10. TIP: All 'window' commands only accept ONE argument. To add 'the pathName' to the movieName, surround the expression with parenthesis: 'window (the pathName & aMovieNameWithoutExtension)'. Do NOT explicitly code the movie name for a 'window' command with its extension (".DIR"), which will change after protection.

11. TIP: If you intend to use a MIAW again later on at some point during your project, do NOT 'forget' it, unless you need the memory freed up. Use 'close window' to just let the MIAW disappear from the screen, and to have it handy for reuse at anytime. Lingo doesn't care if you repeatedly 'close' a window when it's already closed (the same with 'open window' for already-opened windows, but possibly this brings the 'window' to the front). The 'pause' command (outdated in 6.0) is handy for a MIAW: Use it in its 'on deActivateWindow' handler to have the movie pause when the MIAW receives a 'moveToBack' command, and have a 'continue' (also outdated in 6.0) command in its 'on activateWindow' handler to carry on playing when it gets a 'moveToFront'. In 6.0, you need to design special frames to jump to when the 'window' is de/activated. If you're using 'close/open window', you need to place the two commands in the 'on closeWindow' and 'on openWindow' event handlers.

12. TIP: You CANNOT 'forget' a MIAW that is refered to by multiple (global) variables, the 'forget window' command will just be ignored!

13. TIP: A movie-in-a-window ALWAYS has a black border of 1 pixel around its screen rectangle (unless they changed that in 6.0?) !

14. TIP: For 'window' commands to take effect, no 'updateStage' is needed, but opening a movie in a new window might take some time for file loading.

15. TIP: The 'stage' is also a 'window', has some of the 'window' properties, and responds to some of the 'window' commands.

16. TIP: Fore more details, see all the other Lingo elements for MIAW's on this page. And please e-mail me if you come across more Lingo problems with MIAW's or the Stage...

970806: Following is a summary of the 5.0.1 MIAW quirks from Gretchen's www.updatestage.com/501list.html, quoted by her kind permission:

  1. 501: Cursor: If you set a custom cursor in an MIAW, the cursor flickers during playback. Only a problem in authoring. Fine in a projector (Mac)
  2. 501: Cursor: If you specify "cursor 200" in the startMovie handler of an MIAW or a movie you are going to with "go movie" or "play movie", the cursor does not always become invisible. Fix is to do "cursor -1", then "cursor 200". (Win31)
  3. 501: MIAW: Play/play done does not work reliably in a Movie in a Window. This IS in the manual. (Mac)
  4. 501: Field: An editable field on the stage loses "the selection" (text selected by dragging mouse) if another window is clicked.(Mac,Win)
  5. 501+6.0: MIAW - a sprite with any script (even a comment), that is under the drag bar will prevent the user from moving a MIAW opened from a projector. When the user tries to drag the MIAW's drag bar, the sprite underneath the drag bar gets the mouse event instead. Corrected by Rainer Schwake(Mac)
  6. 501+6.0: MIAW - The "Remap palettes when needed" movie option does not remap an MIAW's stage color or shape sprites. Workaround is to cover the stage with a bitmap of the correct color. (Win 95)
  7. More valuable MIAW tips are mentioned in Gretchen's 601 BugList.

--

EXAMPLEs:

The following event handlers are useful in a movieScript of a MIAW ('pause' and 'continue' are outdated in 6.0, but they still work):
on deActivateWindow
  pause
end

on closeWindow
  pause
end

on activateWindow
  continue
  --> this forces a stage redraw, in case it's needed:
  tell the stage to set the stageColor = the stageColor
end

on openWindow
  continue
  tell the stage to set the stageColor = the stageColor
end
---

The following routine will strip a possible extension from a movie name:
set myMovie = (the moviePath & the movieName)
--
if (myMovie contains ".") then
  set StopChar = offset(".", myMovie)
  set  myMovie = char 1 to (StopChar-1) of myMovie
end if
------

Now some general MIAW examples:
put the movieName
-- "Ldoc_Test.DIR"
--
put the windowList
-- [ ]
--
--> The stage is also not in this list, it's empty.

set x = window (the pathName & "MAIN2")
put x
-- (window "Festplatte:Denis:Lingo:MAIN2")

--> ...we have a new windowObject, not yet open, but:
--
put the windowList
-- [(window "Festplatte:Denis:Lingo:MAIN2")]
put string(window 1)
-- "(window "Festplatte:Denis:Lingo:MAIN2")"

--> Now we change the 'thing' to a nicer name:
--
set the name of x = "Lingo Sorcery by Peter Small"
--
put the windowList
-- [(window "Lingo Sorcery by Peter Small")]
--
--> ...he's got himself into that list!
--> Now the MIAW will appear in front of the stage:
--
if NOT windowPresent(the name of x) then alert("Problem!")
else open x

--> Ok, now go and check out Peter's book at:
--> http://www.obsolete.com/dug/sorcery/lingsor.htm


--> Lets wipe away that MIAW:
--
close x
--
--> ...the movie window disappears, but:
--
put x
-- (window "Lingo Sorcery by Peter Small")
put the windowList
-- [(window "Lingo Sorcery by Peter Small")]
--
--> ...it's still there and playing invisibly!
--

--> Now let's first create a problem:
--
put x into aCopyOfTheWindowObject
--
put aCopyOfTheWindowObject
-- (window "Lingo Sorcery by Peter Small")
--
forget x
--
put x
-- (window "Lingo Sorcery by Peter Small")
--
set the name of x = "iLikeThisName"
put the windowList
-- [(window "iLikeThisName")]
--
--> Director will NOT delete a windowObject refered to
--> by a second variable, unless you set that variable to FALSE
--> or 'forget' THAT variable:
--
forget aCopyOfTheWindowObject
--
put aCopyOfTheWindowObject
-- 0
put x
-- 0
put the windowList
-- [ ]


--> Vanished... Want some more?
--
close the stage
--
--> Possibly you find another MIAW behind the stage... ;)

add(the windowList, the stage)
put the windowList
-- [(the stage)]
--
--> ...not visible, but at least mentioned... ;)
--> Let's satisfy the waiting audience:
--
open the stage

--> Except for Win31 (I think), you can also do:
--
set the visible of the stage = FALSE
put the visible of the stage
-- 0


--> Here's kind of a general routine for creating MIAW's,
--> possibly have the needed movie preLoaded:
--
preLoad (the pathName & "Ldoc_Test")
--
global gMyWindow1
--
set gMyWindow1 = window "anyNameYouLike"
--
set the   fileName   of gMyWindow1 = (the pathName & "Ldoc_Test")
set the  windowType  of gMyWindow1 = 2  --> plain
set the titleVisible of gMyWindow1 = FALSE
set the     rect     of gMyWindow1 = (the sourceRect of gMyWindow1) + 150
--
if NOT windowPresent(the name of gMyWindow1) then alert("Problem!")
else open gMyWindow1





[index] _ D5/601 _ 971208:


windowList

system registry property for MIAW's

6.0 Dictionary Error, same in 5.0:

"This property is a list of all the known movie windows."
= Missing:
"This property is a LINEAR list of all the known movie windows.
 The main Stage window is NOT included. The 'windowList' property
 is NOT cleared by a 'clearGlobals' command.
 Setting 'the windowList = [ ]' or using 'deleteAll(the windowList)'
 will 'forget' and delete ALL windows, except those that are still
 refered by user-defined variables."
 --

1. TIP: Lingo's system property 'the windowList' by default is an empty linear list '[ ]', which can be tested AND set, and you can use all valid linear list commands and functions on it.

2. TIP: A newly created windowObject will automatically be included in 'the windowList', as soon as you issue either 'set myWindowVariable = window "anyNameYouLike" ' or 'set myWindowVariable = (the pathName & aMovieNameWithoutExtension)'.

3. TIP: Warning: If you ask Director about a non-existing windowObject, it's automatically generated! If you test 'getPos(the windowList, windowObject)' or even 'objectP(windowObject)' for a 'window' that does NOT exist, that windowObject will automatically be created and added into 'the windowList', even if you test it on a true copy of 'the windowList'!

4. TIP: Use 'count(the windowList)' to retrieve the number of existing windowObjects, the last entry is the MIAW you created last. Test 'the frontWindow' to see which window is in front. If 'the stage' itself is frontmost, 'the frontWindow' returns FALSE (0); if a media editor, a floating palette, or the Message Window is frontmost (during authoring), the result will be '<void>'. Test 'the activeWindow' to see which 'window' the current movie is playing in.

5. TIP: A 'window' can be identified by its position in 'the windowList', as long as there is a window at the specified position: 'close window 1', 'forget window count(the windowList)'. For an unvalid position you'll get an alert 'Script error: Window not found'.

6. TIP: As the Stage is normally NOT in 'the windowList' (only child windows are), you could add the main window in with 'add(the windowList, the stage). Why? Hmm...

7. TIP: If you change the 'name of window' for a MIAW, the 'windowList' will immediately update its according window entry to that new name. This also applies to 'the stage' if you add it into 'the windowList' and then change the 'name of the stage'. (In this case, you can address the Stage with its keyword 'the stage' as well as with its new name, the 'activeWindow' will return '(window "theNewStageName")', but test FALSE on this and prefer evaluating '(the stage)'.)

8. TIP: The 'windowList' property could be a safe place to store some sensitive data of yours, because you can add any entry you like and it will persist across 'clearGlobals'. (Another safe place is the 'name of the stage' for string expressions.)

9. TIP: See 'window' for general MIAW hints and EXAMPLEs.






[index] _ D5/601 _ 971208:


windowType of window

MIAW display property

6.0 Dictionary Error, same in 5.0:

= Missing:
  The 'windowType' -1 is the default type for plain movies-in-a-window,
  which equals type 0.
  On Macintosh only, there are ways to add special windoid types (WDEF)
  to the resources of a projector.

From 'Macromedia Director Corrections':
  Setting 'the windowType' to 6, 7, 9, 10, 11, 13, 14, 15,
  or 17 through 48 assigns a window one of the possible window types.
  For predictable results, use one of the values listed in the table.
  --

1. TIP: Gretchen's page www.updatestage.com/idlt06.html has a nice graphical list of cross-platform windoids: "The Standard Window Types". She lists functioning types of -1, 0, 1, 2, 3, 4, 8, 12, and 16 (no 5, no 49).

2. TIP: See 'window' for general MIAW hints and EXAMPLEs.





(Top)

URL = "http://www.a3w.de/Lingo/Ldoc_MIAWs.html"  (971212)

 Top [Main Page] [About...] [Error Lists] [Ldoc+ Index] [Lingo Groups]
The Ldoc+ © Copyright 97-98 by Denis Wieger Online since June 1, 1997. All rights reserved.
<mailto:Denis@a3w.de
 Top