Song Position Reset

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.

Any ONE…

All right,

Have I asked to many questions?

Cherp Cherp------Cherp Cherp
:nerd:

could u tell us the aim of that one, maybe we could find a simpler way! =)

yours,

mySound = new Sound();
mySound.loadSound(“music.mp3”,true);

Or

mySound = new Sound();
mySound.attachSound(“mySound01”);

With the attachsound code I can also use this code
mySound.start(0,999);

Which tells flash to start the song at 0 and loop forever.

How can I do this same concept with loadSound?
:smirk:

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?

Thanks!
Kirupa :bandit:

There’s mySound.duration to find the duration of the song.

But as far as I know… mySoundObject.start() should work with externally loaded music as well.

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.

Thanks a bunch lost. The problem was that I had streaming set to true. With streaming set at “true”, the mySound.start() feature doesn’t work.

Cheers!
Kirupa :rambo:

:slight_smile: Glad everything worked out for ya.

*Originally posted by waffe *
**mySound = new Sound();
mySound.loadSound(“music.mp3”,true);

Or

mySound = new Sound();
mySound.attachSound(“mySound01”);

With the attachsound code I can also use this code
mySound.start(0,999);

Which tells flash to start the song at 0 and loop forever.

How can I do this same concept with loadSound?
:smirk: **

on(release){
if(playing!=true){
x.loadSound(“na.mp3”,true);
x.start(0,999);
playing = true;
}
}