nightwares mini logoA brief introduction to Director

25. Having a Breakdown

Looking at your newest handler in greater detail.

Director 8.5 Shockwave Studio: A Beginner's Guide

Online reader support forum for the book

Again, a line at a time:

  on LoadMenus

Defines the set of commands associated with the LoadMenus() call.

  if the machineType <> 256 then

Tests the type of computer your file is running on. Any number lower than 256 is a Macintosh computer. For Director 7 on up you could also use the line

  if the platform contains "mac" then

to determine whether your projector is running on the Macintosh platform.

  installMenu cast "helloMacMenu"

If the machineType is less than 256 (or the platform contains the word "mac"), we know that we're running on a Mac, so this tells Director to load the menu bar for Macintosh computers. The final option for the if...then test is braced between an else and end if keyword set.

  installMenu cast "helloWinMenu"

Since the machineType is not less than 256 (or the platform doesn't contain the word "mac"), we know that it's a PC, probably running Windows — so we want to install the Windows-type menu bar.

  END LoadMenus

Ends the LoadMenus() handler definition.


1. Introduction

2. Definition of Objectives

3. Specific Objectives

4. Stage Size

5. Stage Location

6. Setting the Stage's Color

7. Beginning to Enter Script

8. A bit More About the StartMovie() Handler

9. Entering Another Handler

10. A Break-down of the CheckColor() Handler

11. A Quick Test

12. Adding Text to the Stage

13. Preparing to Enter a Frame Script

14. Entering the Frame Script

15. Adding a Quit Button

16. The Progress so Far

17. Preparing to Add a Menu

18. Discussion of Menu Requirements

19. Preparing the Menu Storage Member

20. Entering Menu Functions for Macintosh

21. Entering Menu Functions for Windows

22. Efficientlly Handling Multiple Menus

23. Preparing to Insert the Menus Onscreen

24. Adding the Menu Installation Handler

25. Discussion of the Menu Installation Handler

26. Adding Code for an About Box

27. Review of the Scripts

28. Creating a Projector and Running it