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

Using Alert

Sometimes you want to know about an event that happens only occasionally—maybe some portion of your code that runs only rarely. You do not want to monitor the Message window but would like to be notified when the event occurs. The alert command is a good choice for such situations.

1.
In the Cast window, select cast member 9 again and click the Script button to open the Script Editor window.

2.
Modify the mouseUp handler as shown here in bold:

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

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

The alert command causes a system beep and displays an alert box containing the specified string and an OK button. The string can be a maximum of 255 characters.


Figure .


The alert command is also useful in your finished movie when you need to inform a user of some event, which the user then simply needs to acknowledge by clicking OK.

Once you have created a distributable movie, you may need to get feedback on what your movie was doing at a particular point, what problems it may have encountered, and what information the user may have provided to the movie. You can make sure this information is available by logging Director messages. You will see how to do this in the next task.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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