Stopping Sounds

I l @ ve RuBoard

Although event sounds normally play to the end, you can force them to stop at a specific keyframe. To issue an instruction to stop a specific sound, you must set that sound's Sync parameter to Stop.

To stop playback of a sound:

  1. Create a new 15-frame Flash document with two fairly long event sounds (at least 3 seconds); place one sound in Keyframe 1 and the other in Keyframe 5.

    (For more detailed instructions, see "Adding Sounds to Frames" earlier in this chapter.) In this example, Keyframe 1 contains the sound wolf howl, and Keyframe 5 contains the sound Cricket.

  2. In the Timeline, insert a new blank keyframe at Frame 8 (Figure 14.29).

    Figure 14.29. Inserting a new keyframe cuts off your view of the preceding sound's waveform in the Timeline. If the sound is an event sound, however, it continues playing through the keyframe.

    graphics/14fig29.gif

    Flash cuts off the waveform at Frame 8 because of the keyframe, but on playback, the event sounds continue to play after Frame 8.

  3. Select Keyframe 8.

  4. In the Frame Property Inspector, from the Sound pop-up menu, choose wolf_howl.

  5. From the Sync pop-up menu, choose Stop (Figure 14.30).

    Figure 14.30. To stop a sound's playback at a specific point in a movie, create and then select the keyframe where the sound should stop. From the Frame Property Inspector's Sound pop-up menu, choose the sound you want to stop. From the Sync pop-up menu, chooseStop. Here, the Stop instruction refers to the wolf_howl sound.

    graphics/14fig30.gif

    Flash uses this instruction to stop playback of the wolf-howl sound at Frame 8. Flash places a small square in the middle of Keyframe 8 in the Timeline to indicate that the frame contains a stop-sound instruction (Figure 14.31).

    Figure 14.31. In the Timeline, a small square in the middle of a keyframe indicates the presence of the stop-sound instruction.

    graphics/14fig31.gif

  6. Position the playhead in Frame 1, and play your movie to hear the sounds in action.

    The wolf howl starts immediately; the crickets kick in at Frame 5. When the playhead reaches Frame 8, the wolf cuts out, but the crickets continue playing even after the playhead reaches the end of the movie.

graphics/01icon02.gif Tips

  • The Stop setting and the sound that it stops can be in different layers . The Stop setting stops playback of all instances of the specified sound that are currently playing in any layer.

  • If you want to stop only one instance of a sound, set the Sync parameter of that instance to Stream; then, in the layer containing that instance, put a blank keyframe in the frame where you want that instance of the sound to stop.

  • You can stop all sounds at the same time by adding the frame action stopAllSounds to your movie. For detailed instructions, see Chapter 12.


I l @ ve RuBoard


Macromedia Flash MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Flash MX 2004 for Windows and Macintosh (Visual QuickStart Guides)
ISBN: 0582851165
EAN: 2147483647
Year: 2002
Pages: 243

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