Using Director > Movies in a Window > Creating a MIAW using Lingo

 

Creating a MIAW using Lingo

In Lingo, you create a MIAW by specifying a window's rectangle on the Stage and then specifying the file name for the movie assigned to the window. You can also make the window visible, change its type, set its title, and set the window's size and location.

The simplest way to create a MIAW is to simply open a window for an existing movie.

To create a new MIAW by opening a window for an existing movie:

Follow this example:

open window("movieName")

This statement creates a window, assigns it the movie movieName, and opens it on the Stage at the location where movieName was originally authored. At this point, you can use the commands discussed in the rest of this chapter to set various attributes of the MIAW.

You can also use a movie's file name as the argument for the open window command. This approach assigns that movie to a window and instructs Director to use the file name as the window title.

To create a MIAW using a file name and the Open Window command:

Follow this example:

on beginNewMovie theMovie
	global newWindow
	set newWindow to window theMovie
	set newWindow.titleVisible to FALSE
	open newWindow
end beginNewMovie

This version of the handler uses the movie's rectangle to determine the size of the window's rectangle.

You can also assign a MIAW to a variable, which makes it easier to write the handler and reuse it.

To assign a MIAW to a variable:

Follow this example:

on beginNewMovie theMovie
	global newWindow
	set newWindow to window "The Big Picture"
	set newWindow.rect to rect(0, 0, 250, 200)
	set newWindow.filename to theMovie
	set newWindow.titleVisible to FALSE
	open newWindow
end beginNewMovie

The variable newWindow contains a new window named The Big Picture. The handler specifies the coordinates of a rectangle, instructs Director to use that rectangle as the window named The Big Picture, and then assigns a movie file to the window. The handler makes the title bar at the top of the window invisible and then opens the window.