Looping mp3

Hola,

Going by past record, after posting this, I should have an answer in just a few short seconds. Here goes

All I want to do, is make the mp3 loops on my site loop. Right now they just stop playing. I need the one that starts up automatically to loop nonstop, also whenever the user presses the prev. or next button, that mp3 needs to loop nonstop as well. Here’s what I got, if someone could just let me know what I need to insert…I know it’s something like (loop 999 times) or something…I’ve seen it before. Thanks

var tracks = [“4.mp3”, “5.mp3”, “6.mp3”,“7.mp3”], i = 0;

track = new Sound();

track.loadSound(tracks*, true);

stopBTN.onRelease = function() {
track.stop();
};

playBTN.onRelease = function() {
track.loadSound(tracks*, true);
};

nextBTN.onRelease = function() {
i = Math.min(i+1, tracks.length-1);
track.loadSound(tracks*, true);
};

prevBTN.onRelease = function() {
i = Math.max(0, i-1);
track.loadSound(tracks*, true);
};

when you’re loading sound and set streaming to true, you can’t control the start properties or delay properties


loopSound = function () {
        mySound.loadSound("test.mp3", true);
};
mySound = new Sound();
mySound.loadSound("test.mp3", true);
mySound.onSoundComplete = loopSound;

So can I just add that in? I don’t understand.

Do I need to insert all my tracks into the spot where you put test.mp3??? I declared all the variables earlier, so I was wanting to just loop instead of having it finish

just use your array name


var tracks = ["4.mp3", "5.mp3", "6.mp3","7.mp3"], i = 0;

track = new Sound();

loopSound = function () {
       track.loadSound(tracks*, true);
};

track.loadSound(tracks*,true);
track.onSoundComplete = loopSound;


stopBTN.onRelease = function() {
track.stop();
};

playBTN.onRelease = function() {
track.loadSound(tracks*, true);
};

nextBTN.onRelease = function() {
i = Math.min(i+1, tracks.length-1);
track.loadSound(tracks*, true);
};

prevBTN.onRelease = function() {
i = Math.max(0, i-1);
track.loadSound(tracks*, true);
};

You don’t need to call the loadSound method again.
[AS]track.onSoundComplete = track.start;[/AS]
That would do…

what i did to mine as i dont know Action Scripting, I made another movie clip and place the mp3 there.

then i followed what ** kax ** told me to place it on one of the layer in your main movie clip. then use the “loadmovie” code thingy. it works with me, but the only thing is, it takes a while to load it using a 56 K Modem connection because mp3 is quite big file.

I can only contribute little things as i am a begginer, but hope that helps

nope, everything works just fine now…Love it! Knew I’d have an answer tonight.

Yup… you can always trust in kirupaforum.com. :stuck_out_tongue: