|
May 28, 2001 Rewinding a SWF Tips: May 2001
Yehuda Shiran, Ph.D.
|
|
In some of your applications you may need to use Flash Audio and JavaScript directly, without any prepackaged APIs such as FlashSound JavaScript API. You will enjoy more features, methods, and properties, but you'll have to take care of all the tiny details that are taken for granted when using FlashSound API.
One of the "tiny" details is embedding the sound object. The JavaScript file included in this tip, Rewind() Flash method. The syntax is just Rewind(). It positions the playhead at the beginning of the track, ready to play the sound from the first frame. When you have several sound tracks on the same SWF, the playhead will jump to the first track when you call Rewind(). Try the animal sounds below. When you click the Rewind() link, the playhead goes to the first frame of the track. When you click the Play link, the playhead will start moving, sounding off "dog barking". Play with the animal sounds. Rewind the track and then play() it. | Dog Barking | Frog Ribbet | Horse Whinny | Cat meow | Rewind | Play | Here is the source code:
People who read this tip also read these tips: Look for similar tips by subject: |