PDA

View Full Version : Duration slider to audio controller



gazzer
September 15th, 2003, 08:18 PM
Trying to add a duration slider to a play and stop controller similar to what you see when viewing a .wav or .aiff file in a browser. I would like the viewer to be able to go backward or forward during a speech. Final delivery is in Dreamweaver as a .swf. Can anyone kick start me into this?

Thanks,
Gaz

eki
September 16th, 2003, 06:31 AM
Hi,
You need to use the 'duration' and 'position' peoperties of the sound object in the same way you would use 'getBytesLoaded' and 'getBytesTotal' to build a preloader.

duration:

mySound.duration

Description

Property (read-only); the duration of a sound in milliseconds.

position:

mySound.position

Returns

Number of milliseconds the sound has been playing.

Description

Property (read-only); returns the number of milliseconds a sound has been playing. If the sound is looped, the position will be reset to 0 at the beginning of each loop.

SHO

if mySound.duration == 100% (xscale of bar)
mySound.position = n%

or

if mySound.duration == width of bar
mySound.position = some x position on the bar

gazzer
September 16th, 2003, 07:23 AM
EKI,

Thanks for responding. This makes sense. I will give it a whirl and let you know how it goes.

Gaz