I thought it was about time my Pretty Noise Toys had preloaders on them, so I went about using MovieClipLoader like so:
mcLoader = new MovieClipLoader();
loadListener = new Object();
mcLoader.addListener(loadListener);
mcLoader.loadClip("carillon1.swf", loader_mc);
loadListener.onLoadStart = function() {
loader_mc.stop();
};
loadListener.onLoadProgress = function(loadTarget, loadedBytes, totalBytes) {
preloaded = Math.floor(loadedBytes/totalBytes*100);
myText_txt.text = preloaded+"%";
bar_mc._xscale = preloaded;
};
loadListener.onLoadComplete = function() {
myText_txt._visible = false;
titleText_txt._visible = false;
downloadText_txt._visible = false;
bar_mc._visible = false;
loader_mc.play();
};
The preloader works perfectly, except that no sounds can be heard in the loaded movie clip. All of the sounds in the loaded clip (there are 9 of them) are triggered using attachSound, and I have tried changing the object name to _root.s1 etc thinking it may have been a problem with the addressing of the loaded movie or something, but it didn’t help.
Naturally, the sounds work fine when the loaded movie clip is played standalone (eg, as currently on my website), and it does appear that the sounds are being downloaded with the loaded swf (as one would expect), since the download simulator shows it taking a fair old while to dl.
Just in case, here is a sample of the attachSound code from the loaded movie:
s1unHit = true;
_root.s1 = new Sound();
_root.s1.attachSound("s1");
_root.s1.setVolume(50);
_root.s1.onSoundComplete = function() {
sound1_mc.gotoAndStop(1);
s1unHit = true;
};
I have searched and searched for an answer to this, but to no avail, but the only two posts I can find about it (here and on actionscript.org) remain unanswered .
Any help much appreciated!