OK, So I'm trying to Preload Sound in My Main Preloader. However I only want the Sound to start playing in a seperate SWF loaded at level 50. So far this is my code on Frame 1 of the Preloader Page.
firstSound.loadSound ('../Assets/Sounds/Main_Background.mp3', false)
secondSound.loadSound ('../Assets/Sounds/Main_Background2.mp3', false)
thirdSound.loadSound ('../Assets/Sounds/Main_Background3.mp3', false)
fourthSound.loadSound ('../Assets/Sounds/Main_Background4.mp3', false)
SoundBytesTotal =(_root.firstSound.getBytesTotal())+(_root.secondSound.getBytesTotal())+(_root.thirdSound.getBytesTotal())+(_root.fourthSound.getBytesTotal());
SoundBytesLoaded=(_root.firstSound.getBytesLoaded())+(_root.secondSound.getBytesLoaded())+(_root.thirdSound.getBytesLoaded())+(_root.fourthSound.getBytesLoaded());
BytesTotal =getBytesTotal();
BytesLoaded=getBytesLoaded();
percent = Math.round((SoundBytesLoaded+BytesLoaded)/(SoundBytesTotal+BytesTotal)*100);
PercentLoaded.text = percent+"%";
So that works. Then I load an SWF at level 50 which has this code:
PlaySong = random(4);
if (PlaySong == 0) {
_parent.firstSound.start(0, 999);
} else if (PlaySong == 1){
_parent.secondSound.start (0, 999);
} else if (PlaySong == 2) {
_parent.thirdSound.start (0,999);
} else {
_parent.fourthSound.start (0,999);
}
stop();
This gives me no sound. I've been playing with this for days now but always either the preloader or the sound works, Never both.
I would really appreciate any help on this one. I know this code is kind of long so thank you for giving your time and patience.
At Your Service,
-Keyper
firstSound.loadSound ('../Assets/Sounds/Main_Background.mp3', false)
secondSound.loadSound ('../Assets/Sounds/Main_Background2.mp3', false)
thirdSound.loadSound ('../Assets/Sounds/Main_Background3.mp3', false)
fourthSound.loadSound ('../Assets/Sounds/Main_Background4.mp3', false)
SoundBytesTotal =(_root.firstSound.getBytesTotal())+(_root.secondSound.getBytesTotal())+(_root.thirdSound.getBytesTotal())+(_root.fourthSound.getBytesTotal());
SoundBytesLoaded=(_root.firstSound.getBytesLoaded())+(_root.secondSound.getBytesLoaded())+(_root.thirdSound.getBytesLoaded())+(_root.fourthSound.getBytesLoaded());
BytesTotal =getBytesTotal();
BytesLoaded=getBytesLoaded();
percent = Math.round((SoundBytesLoaded+BytesLoaded)/(SoundBytesTotal+BytesTotal)*100);
PercentLoaded.text = percent+"%";
So that works. Then I load an SWF at level 50 which has this code:
PlaySong = random(4);
if (PlaySong == 0) {
_parent.firstSound.start(0, 999);
} else if (PlaySong == 1){
_parent.secondSound.start (0, 999);
} else if (PlaySong == 2) {
_parent.thirdSound.start (0,999);
} else {
_parent.fourthSound.start (0,999);
}
stop();
This gives me no sound. I've been playing with this for days now but always either the preloader or the sound works, Never both.
I would really appreciate any help on this one. I know this code is kind of long so thank you for giving your time and patience.
At Your Service,
-Keyper