Skip to main content
July 16, 2006
Question

onSoundComplete for external swfs

  • July 16, 2006
  • 1 reply
  • 330 views
My question is, does onSoundComplete works for sounds from externally loaded swfs (these are loaded into 2 different movieclips mc1 and mc2). I want swf1 to unload and swf2 to load after the sound in swf1 has completed.
I used....
mc1.song1.onSoundComplete = function(){
unloadMovie(mc1);
mc2.loadMovie("song2.swf");
}

And nothing happens when song1 has completed, and I know there is no problem with the external sounds because they play just fine when they need to.
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 16, 2006
the answer is yes.

if you're code is not working it's probably because you have a path problem or you're defining your onSoundComplete handler before mc1.song1 exists. (ie, make sure loading into mc1 is complete and song1 has been instantiated before executing the code you showed.)
July 16, 2006
Thats the problem, im sure the path is right because im using the same path i used to pause, stop, play the sound, and i tried adding if mc1.getBytesLoaded == mc1.getBytesTotal to it and it still doesnt work, any other ideas?
kglad
Community Expert
Community Expert
July 16, 2006
you need complete preloader code to execute in a loop.