nightwares mini logoA brief introduction to Director

20. Apple Corps

Defiining the Macintosh menu.

Director 8.5 Shockwave Studio: A Beginner's Guide

Online reader support forum for the book

  menu: @
  About This Program.../A | AboutBox()
  menu: File
  Quit/Q | QUIT


Note both the single-spaced lines and the presence of a few odd characters. First there's the "@" symbol, which is always used in a menu-creation context to refer to the Apple menu, virtually omnipresent in the upper-lefthand corners of all Mac monitors. What you have essentially said is the following:

An Apple menu will exist, with the item "About This Program..." immediately beneath it.

Note too that there's a "/A" following the regular About This Program... text. The forward-slash character is used, in defining menus, to specify the single key which can be pressed in combination with the COMMAND (Macintosh) or CONTROL (Windows) keys in order to execute the function in the menu. That is, in the menu above, the user could either select About This Program... from your Apple menu or press Command-A, according to the menu you've defined. If you choose not to allow command keypressing, just leave out the characters with forward-slashes.

Next is the vertical bar character, | . This is used to tell Director — and your projector, when you compile it — that what follows is a one-line command to be executed when that menu item is selected (or its command key equivalent is pressed).

Under Director for Mac you can also enter ≈, which is the OPTION+X key combination and gives you a wavy equals sign. However, this is not a recognizable key combination under Windows, so what you'd end up with after the port is garbage onscreen wherever the ≈ character was under Mac.

Since the vertical bar works for both Mac and Windows, it makes sense to just use | in place of ≈, regardless of what platform you're working in. (And it's esier to remember and type, being simply the shifted backslash character and in plain sight on all keyboards.)

Now we move on to the File menu, which is simply defined by a new line and the menu: keyword. That menu contains only one item, Quit, which can be selected using the mouse or by pressing Command-Q. This has the same effect as clicking your QUIT button onscreen, as you have probably inferred by now.


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