
Chapter 18
458
Play Sound
Use the Play Sound action to play a sound. For example, you might want to play a
sound effect whenever the mouse pointer rolls over a link, or you might want to
play a music clip when the page loads.
Note:
Browsers may require some kind of additional audio support (such as an audio
plugin) to play sounds. Therefore, different browsers with different plugins often play
sounds differently. It’s difficult to reliably predict how visitors to your site will experience the
sounds you provide.
To use the Play Sound action:
1
Select an object and open the Behaviors panel.
2
Click the Plus (+) button and choose Play Sound from the Actions
pop-up menu.
3
Click Browse to select a sound file, or enter the path and file name in the
Play Sound field.
4
Click OK.
5
Check that the default event is the one you want.
If it isn’t, choose another event from the pop-up menu. If the events you want
are not listed, change the target browser in the Show Events For pop-up menu.
Popup Message
The Popup Message action displays a JavaScript alert with the message you
specify. Because JavaScript alerts have only one button (OK), use this action to
provide information rather than to present the user with a choice.
You can embed any valid JavaScript function call, property, global variable, or
other expression in the text. To embed a JavaScript expression, place it inside
braces (
{}
). To display a brace, precede it with a backslash (
\{
).
Example
The URL for this page is {window.location}, and today is
{new Date()}.
Note:
You can’t control how the JavaScript alert looks; that’s determined by the visitor’s
browser. If you want more control over the appearance of your message, consider using the
Open Browser Window behavior. For details, see “Open Browser Window” on page 456.
Содержание 38028779 - Macromedia Dreamweaver - Mac
Страница 1: ...macromedia Using Dreamweaver...
Страница 148: ...Chapter 4 148...
Страница 296: ...Chapter 12 296...
Страница 472: ...Chapter 18 472...
Страница 512: ...Chapter 21 512...
Страница 562: ...Appendix 562...