PDA

View Full Version : sound duration


____
03-31-2003, 07:49 PM
mySound = new Sound();
mySound.attachSound("myLinkageName");
mySound.start();
duration = mySound.duration; //(total time of sound)
elapsed_time = mySound.position; //(elapsed time of sound)

So how would you use these in conjunction to reverse, pause, or fastforward a song. From searching I've determined that these measure the song in Milliseconds but haven't seen anything on how to rewind/fast forward it.
Would it be similar to a text box, where you create a loop to where you press something it adds or subtracts milliseconds?
Thx in advance
Eric

Jesse
03-31-2003, 09:16 PM
Position is a read only property. I don't think it's possible (currently) to set the position of a sound.

zebbah
03-31-2003, 09:32 PM
There's a sample file on the Macromedia website that fast forwards an rewinds loaded sounds (at least I think they're loaded...).

Maye it can give you some ideas?

http://www.macromedia.com/devnet/mx/flash/sample_files/html/load_sounds.html

Jesse
03-31-2003, 09:49 PM
There you go. I didn't know it but you in fact can start at any point by simply specifying the start position in the start() method. As that URL states, that source file comes with Flash MX on the Flash MX CD. Check it out.

____
04-02-2003, 03:55 PM
thanks a lot
helped a bunch