Previous Page
Next Page

Tripod >> 3pod Tips & Learning and manuals for educations

Recipe 17.10. Starting and Stopping Sounds with Buttons

Problem

You want users to be able to start and stop a sound using buttons.

Solution

Create two buttons. On the Down frame of each button, add the same sound. On the Start button, synchronize the sound to Start. On the Stop button, synchronize the sound to Stop.

Discussion

Flash offers a convenient way to start and stop sounds by using the Start and Stop synchronization settings, respectively. You can readily create buttons that start and stop a sound when you know how to use the Start and Stop synchronization settings properly:

  1. Create a button symbol, and place an instance on the stage. This button will be the start button.

  2. Edit the start button, and add the sound to its timeline on the Down frame.

  3. Make sure to set the sound's synchronization to the Start option.

  4. Return to the main timeline.

  5. Create a second button symbol, and place an instance on the stage. This button will be the stop button.

  6. Edit the stop button, and add the sound to its timeline on the Down frame.

  7. Change the sound's synchronization setting to Stop. This will cause Flash to stop playing all instances of that particular sound.

That is all there is to starting and stopping a sound with buttons. When you click on the start button, the sound should begin to play, and when you click on the stop button, the sound should stop.

You can use the Stop synchronization setting to stop a sound whether it was started by the playhead entering a timeline keyframe or by the user pressing a button. Regardless of the way in which the sound was started, the Stop synchronization stops all instances of that particular sound that are playing.

Tripod >> 3pod Botom Tips & Learning and manuals for educations

Previous Page
Next Page

 

bluedot bluedots greydots pinkdots

Tripod >> 3pod Tips & Learning and manuals for educations