I need to reset my song position after the 1st song has played for 5 sec.
if (myMusic.position>5000 ) {
myMusic.position=0;
combobox.setselectedindex(combobox.getselectedindex()+1);}
This is an auto play function that changes songs after 5 seconds.
What happens with the code above is after 5 sec the next song is selected and the position goes to 0 and then immediately back to 5 sec and continues counting up.
Hey everyone,
Expanding upon his question, is there a way for me to find out the maximum duration of a sound so that I can loop it using a similiar line such as this:
[AS]if (myMusic.position>5000 ) {[/AS]
Basically, I am trying to loop the following sound loop using an MP3 loaded from an external source: [AS]mySound.loadSound(“sound1.mp3”, true);[/AS]
Unfortunately, mySound.start(offset, loop) does not work with sounds loaded from an external source…or am I making a mistake somewhere?
Ok here we go Kirupa, this info was taken from www.kennybellew.com (the ultimate sound object tutorial)…
All of the controls for sound objects described thus far work for dynamically-loaded streaming MP3’s, with the exception of starting the MP3 with the mySoundObject.start() method. Streaming MP3’s start as soon as there is enough data to play the sound; therefore, the loadSound call to the sound object is the start command. However, you should be able to stop the streaming sound and restart it with the mySoundObject.start() call. Currently, this option is only partially available due to a bug in the Flash Player.
With the r40 release of version 6 Flash player, this issue was addressed. If you are going to use the mySoundObject.start() method to restart the streaming sound object, you must make sure that the user has the latest Flash player. The Flash Deployment Kit from Macromedia provides instructions on making sure the latest plug-in is installed on the user’s computer.