Sound Loop

Hi,

Does anyone know the code to loop an externally loaded sound? The loop is about 5 seconds but I would like to loop it 30 times making it much longer.

Here is my code to load it.

on (press) {
stopAllSounds();
}
on (release) {
mySound = new Sound();
mySound.loadSound(“music/ambient.mp3”, true);
}

Thanks.

mySound.start(0, 30);

(first make sure it has loaded!!!)

Not to come off rude to you, but yes I know that code, I tried it and it gave me a script error.

ok now the error is gone but the soun doesn’t loop.

Here is the code now.

on (press) {
stopAllSounds();
}
on (release) {
mySound = new Sound();
mySound.loadSound(“music/rock.mp3”, true);
mySound.start(0, 30);
}

!! :wink:

mySound.onSoundComplete = mySound.start;

Do you mean?

mySound.onSoundComplete = mySound.start(0, 30)

Nope, I mean:

mySound.onSoundComplete = mySound.start;

:stuck_out_tongue:

well alas no luck. :frowning:

Here is the code:

on (press) {
stopAllSounds();
}
on (release) {
mySound = new Sound();
mySound.loadSound(“music/techno_dance.mp3”, true);
mySound.onSoundComplete = mySound.start;
}

The code seems to be fine… attach your FLA so I can see what’s wrong. :wink:

Here ya go Koge. :wink:

Done. :wink:

well thanks for the fla update Kode but yet it still doesn’t loop the sound.

Define Loop: The Sound loop (5 seconds) playing over and over by a specifed number.

Is that what you did and I am missing something or?

Ok… that’s weird. I tested it and it worked just fine!! :frowning:

hmm well I wouldn’t lie. lol