(MX)Dynamically loading mp3's

Hi,

Dynamically loading mp3’s

I am currently tearing my hair out trying to get this thing to work.

I have 10 buttons, 1 stop and the others track 01 - 09, these are all in one .swf file.

The buttons are all on one layer, on another i have defined all my sounds like so :

firstSound = new Sound();
firstSound.loadSound(“track 01.mp3”);

through to

ninthSound = new Sound();
ninthSound.loadSound(“track 09.mp3”);

Then i have the actions for my buttons

on (press) {
//Track 01 Button
stopAllSounds();
firstSound.loadsound(“track 01.mp3”);
firstSound.start(0,999);
}

through to

on (press) {
//Track 09 Button
stopAllSounds();
ninthSound.loadsound(“track 09.mp3”);
ninthSound.start(0,999);
}

I have uploaded the 9 mp3’s, the swf & html file to same folder and this is what happens :

http://www.nrgdesigns.net/bgsounds/buttonstest.html

When any of the 9 track buttons are pressed 7 of the nine mp3’s download all at the same time from pressing 1 single button:q: (no track 3 or 9 which play fine normally and have definitely been uploaded) and none of the sounds work. But, when i refresh the page the 7 mp3’s that were downloaded now work :q: . The stop all sounds still work on buttons 3 & 9. On my friends comp he dl’s the same 7 tracks but they don’t even play at all for him
:q:

Can anyone help me Plzzzzzzzzzzzzzzzzzzzzzzzzzz

**When any of the 9 track buttons are pressed 7 of the nine mp3’s download all at the same time from pressing 1 single button:q: (no track 3 or 9 which play fine normally and have definitely been uploaded) and none of the sounds work. Can anyone help me Plzzzzzzzzzzzzzzzzzzzzzzzzzz **

First of all…

WHAT?

*Originally posted by eron19 *
**

First of all…

WHAT? **
Yes, I’m not sure I understand what’s happening either :P. But there’s a really good tute on sounds here: Flash Kit Community Forums

It should contain everything you need an more. If there’s something you don’t understand, just post…

pom :cowboy:

OK,

I am trying to do this from that tutorial from flash kit, but it doesn’t cover much of dynamically loading mp3’s.

http://www.nrgdesigns.net/bgsounds/buttonstest.html

When the page first loads up ^^^^^^^^^

This is what happens

I press the track 01 button ONCE only.

Then i’m watching my traffic and i know that 7 of the tracks all download from this single click on track 01 button.(no track 03 or track 09)

This is definitely happening because i’m watching my temp internet files and each time i delete them and try again the same thing happens.

After the 7 mp3’s files have downloaded the buttons still do not work, until, i refresh my page. Then those 7 buttons work.

Is that any clearer ?

I can upload the .fla if that will help at all, let me know.

Do you know of a better way to do this, that works ? I would be very grateful if anyone could show me.

The end result i am after is to have 9 play buttons(track 01 - 09) and a stop button. The stop button obviously has to stop any of the tracks from playing. The 9 play buttons should check to see(on press) if any other sounds are playing first and if so stop them, then start playing the track associated with it.

If any more explanations are needed please ask me,

Thanx again for your time

:slight_smile:

Latest update

I was wrong about the 1 button loading all the mp3’s.

As soon as you enter the page

http://www.nrgdesigns.net/bgsounds/test.html

all the mp3’s start downloading without pressing a single button!

:frowning:

Once they r downloaded the buttons work for me, but they only seem to work for me and no-one else
Does this help anymore ?:q:

im guessing maybe its because they havent downloaded all the way. you should check if they have loaded fully. thats what im thinking. because if they work for you, then it works. just because it doesnt work for them doesnt mean there’s something wrong. just check if theyve downloaded fully. i believe you can use getBytesLoaded() for that. sound.getBytesLoaded(). im not sure you, you will have to look into it.

There’s A Tutorial On This Site, for
Dynamically Loading Sound. Check it out sometime.

testing