Using the Message Window

   

Director's Message window is a way for you to "talk" to Director, using the only language it understands: Lingo. When you type a Lingo command in the Message window, Director executes the command instantly. The Message window is therefore a very useful tool for testing and debugging scripts.

You can also use the Message window to keep an eye on what's happening behind the scenes while a movie is playing. When you turn on the Message window's Trace feature, it gives you a continuous, real-time report on the Lingo commands Director is executing. If your scripts aren't working as expected, this technique can help you uncover the problem.

To execute commands from the Message window:

  1. Choose Window > Message to open the Message window ( Figure 15.46 ).

    Figure 15.46. The Message window allows you to communicate with Director in real time.

    graphics/15fig46.gif

  2. Type a Lingo command in the upper pane of the Message window and press Enter (Windows) or Return (Mac).

    Director executes the command. For example, if you typed go to frame 15 , Director would move the playhead to frame 15 ( Figure 15.47 ).

    Figure 15.47. Director instantly executes any command that you type in the Message window.

    graphics/15fig47.gif

graphics/tick.gif Tip

  • If you want to enter commands automatically, the Message window offers the same Lingo pop-up menus that the Script window has. See "To insert Lingo elements into a script without having to type them," earlier in this chapter.


To get the value of expressions in the Message window:

  1. Choose Window > Message to open the Message window.

  2. In the upper pane of the Message window, type put , followed by an expression whose value you want to find out, and press Enter or Return.

    For example:

    • If you wanted to know the product of 23 multiplied by 17, you'd type put 23 * 17 .

    • If you wanted to know the value of Director's time function (that is, if you wanted to know the current time), you'd type put the time .

    • If you wanted to know the current value of the global variable named gMyVariable , you'd type put gMyVariable . (See the next section to learn about variables .)

Director reports the result in the lower pane of the Message window ( Figure 15.48 ).

Figure 15.48. When you enter a command (such as the put command) that requires a response from Director, Director responds in the lower pane.

graphics/15fig48.gif

To trace scripts while a movie is playing:

  1. Choose Window > Message to open the Message window.

  2. Click the Trace button to select it.

  3. Play your movie.

    Director reports each Lingo command it executes in the lower pane of the Message window. In addition, it reports other information such as the name of the handler that contains the commands, and the frame that the playhead is in when the commands are executed ( Figure 15.49 ).

    Figure 15.49. When the Trace button is selected, the Message window displays information about each handler that Director executes.

    graphics/15fig49.jpg

graphics/tick.gif Tips

  • The lower pane of the Message window can fill up quickly when Trace is turned on. In most cases, you won't be able to read the reports in real time. Instead, you can use the scroll bar to scroll through the contents of the window after the movie has finished playing.

  • To clear the Message window, click the Clear button.


   


Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
ISBN: 1847193439
EAN: N/A
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net