Task: Send a Message to the Output Window

I l @ ve RuBoard

The best way to become familiar with the Output window is to use it. Let's write a simple program that sends a message to the window.

  1. Start Flash MX and create a new movie.

  2. Select the default first frame of the movie and then open the Actions panel, if it is not already open . Expand the Actions panel so that it is much bigger than the default size .

  3. Use the pop-up menu in the upper-right corner of the Actions panel to set the Actions panel mode to Expert.

  4. Click in the script area of the Actions window so that you see an insertion cursor there.

  5. Type the following script in the Actions panel:

     trace("Hello World"); 

    The result should be an Actions panel that looks like Figure 4.1.

    Figure 4.1. The Actions panel contains a simple one-line script that sends a message to the Output window.

    graphics/04fig01.jpg

  6. Choose Control, Test Movie to run the movie.

The movie takes a second to run. You end up with a blank window that represents your running movie. Because no graphics are in your movie, there is nothing to show.

The Output window also appears with the words "Hello World," as you might expect. Figure 4.2 shows this simple window.

Figure 4.2. The Output window contains the message that the trace command specified.

graphics/04fig02.jpg

Like the Actions panel, the Output window has a small pop-up menu in the upper-right corner. You can use it to copy the text in the Output window or clear all the text. You can also search the text in the window, save it to a file, or print it.

One last option in the pop-up menu lets you set the current debug level. You can choose only to have error messages displayed, have minor warnings displayed as well, or have no error messages displayed at all.

We'll use the Output window throughout the rest of this hour and in many other times throughout the book.

I l @ ve RuBoard


Sams Teach Yourself Flash MX ActionScript in 24 Hours
Sams Teach Yourself Flash MX ActionScript in 24 Hours
ISBN: 0672323850
EAN: 2147483647
Year: 2002
Pages: 272

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