• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 30. Monitoring Director > Sending Yourself Feedback

Sending Yourself Feedback

Another approach that you will find useful when authoring movies is to use the Message window to send yourself messages while your movie is running. This technique is especially handy when you want only a quick check of a particular element: for example, maybe a handler does not seem to be getting called, but since you get no obvious feedback, it is hard to tell. This task uses the beep command and the Message window to enable you to perform rapid testing.

1.
Open Start2.dir in the Start folder within the Lesson 30 folder and save the file as Log.dir in your Projects folder.

This movie contains an input field for a name, two check boxes, and two buttons as the interactive elements. Cast members 6 through 12 are the elements you see on the stage, and cast member 1 is a behavior script. This movie might be used to send co-workers quick memos, although this example version doesn't actually do anything. It is, however, a good template to use for generating diagnostic messages.


Figure .


Look at the score. The behavior script in the behavior channel at frame 10 (cast member 1) is used to loop the movie on that frame. Sprites 3 and 4 (cast members 7 and 8) are check boxes created using the tool palette. By default, check boxes appear checked or unchecked as the user clicks them; you don't need to write any Lingo to implement this behavior.


Figure .


Now suppose you want to know whether one of the buttons is being clicked. Since there is no visual feedback, you can add a beep command to the handler for the button cast member.

2.
In the Cast window, select cast member 9 , the Submit button. Click the Script button to open a Script Editor window for the cast member.

By default, a mouseUp handler has been started for you.

3.
Modify the mouseUp handler by adding the line shown here in bold:

on mouseUp
  beep       --Sound the system beep.
end

4.
Close the Script Editor; then rewind and play the movie. Click the Submit button.

The beep sounds. This device is so simple, but it can be so useful. Imagine you are looking at a case statement buried in a handler 100 lines long. A simple beep command can tell you if a particular line is being reached, and you need only a minute or two to write the code (remember to remove this script when you are done checking, though).

Sometimes, however, you may want to know more than whether a certain line is being reached. You may also want to display information about a situation. You can use the put command and the Message window do this just as easily.

5.
Open the script for cast member 9 again and make the changes shown here in bold:

on mouseUp
  put "The button was clicked and this could be useful to know."
end

6.
Close the Script Editor; then rewind and play the movie. Click the Submit button.


Figure .


7.
Stop the movie and open the Message window (Windows Ctrl+M, Macintosh Command+M).

The put command causes the string you provided to be displayed in the Message window. Again, it takes only a moment to create this handler, but it can quickly lead you to possible problems in your Lingo code.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint