Previous Page
Next Page

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

Recipe 17.8. Looping Sounds

Problem

You want to loop the playback of a sound.

Solution

Set a Loop value for the sound in the Property inspector.

Discussion

Flash allows you to loop sounds within your movies. This can be a great benefit to you, because you can create longer soundtracks without increasing your movie's file size. You can import a short sound file, add it to a keyframe as in Recipe 17.3, and then set the number of times you want it to loop. You can loop a sound only in whole number increments. For example, you can loop a sound three times, but not three-and-a-half times. And if you attempt to enter a non-integer value, Flash will prompt you to fix your entry.

In order to set the number of times to loop a sound, select the keyframe into which you have placed the sound, and then locate the Loop field in the Property inspector. By default, the loop value is 0. A value of 1 or less (including negative numbers) results in the sound playing once. Otherwise, the sound plays the number of times you specify, without any pause in between. The valid range of values for the loop value extends up to 2,147,483,647. If you enter a value greater than that, Flash will automatically reassign a value of 2,147,483,647.

Generally, looping works best with sounds that you have synchronized using either the Start or Event setting. Because of the way that the Stream synchronization works, Flash requires that you first create enough frames in order to play the sound. In most looping scenarios, this is not something you want to have to deal with. After all, usually you want looping sounds to continue to play regardless of whether the playhead is moving. Another problem with trying to loop sounds set to Stream is that the Flash movie's file size will increase.

Also, although looping sounds offer a way for you to add continuous sound to your movie, it is a technique that has been overdone and has become cliché. Don't let this completely deter you from implementing this techniqueif done carefully and with some careful consideration, it can have a nice effect. But a single, four-beat loop that continues for hours can often have the effect of aggravating users. If you are unsure of the effect of your musical selection, at least give the user the option to stop the sound. See Recipe 17.10 for more information on how to achieve this.

See Also

Recipe 17.3. Also see Recipe 17.10 for more information on how to stop a looping sound or how to restart it after it has been stopped.

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