ForumsProgramming ForumMusic: Internal or External?

0 2927
Diddy645
offline
Diddy645
23 posts
Nomad

In one of my games, I have the music loaded externally in order to keep file size down so that it will load faster. My computer is really fast and I never noticed a problem with the music until I went onto a computer with slow internet. The game would start playing and then about a minute later, the music would play. This wouldn't be so bad, but in my game, every time you die, the music has a "stop" command. With the slow internet, if you die before the music starts, then the music never stops, and if you start playing again, it starts a second song on top of the first one.

I was wondering if loading the music internally would make the game load 100% before even starting, which would prevent this from happening.

Just in case there are any porblems, here is my current music code:


//Music Variables
var bqsong:URLRequest = new URLRequest("bqsong.mp3"
var sound:Sound = new Sound();
var controller:SoundChannel;

function soundLoaded(event:Event):void
{
controller = sound.play(0,5);//Loops 5 times
controller.stop();//Stops the music
}
sound.addEventListener(Event.COMPLETE, soundLoaded);
sound.load(bqsong);


The bqsong.mp3 is uploaded on the same server that has the game, which is another problem I might have if I tried to upload it here.
  • 0 Replies
Showing 1-0 of 0