So I thought all the errors in my site were gone . . . I have certain generic sounds that play in a various dynamic clips. When I unloaded them their timelines continue in the background and trigger sounds long after they are gone.
The only examples I can find of unloading all streams when unloading a clip specifically name the instances of the sounds and netStreams.
I need to just clear all aspects of these dynamic clips without specifically referencing the instance names of their sub properties.
This is the direction I’m going in:
var clipLoader:Loader;
function closeAllStreams(evt:Event) {
clipLoader.SoundMixer.stopAll;
}
clipLoader.loaderInfo.addEventListener(Event.UNLOAD, closeAllStreams);
function loadNextClip():void {
if (clipLoader != null) {
unloadClip();
}
clipLoader = new Loader();
addChild(clipLoader);
var clipName:URLRequest = new URLRequest(parent.nextClip);
clipLoader.load(clipName);
parent.transition_mc.gotoAndPlay("clear");
}
function unloadClip():void {
var count:int = this.numChildren;
for (var i:int = 0; i <count; i++) {
this.removeChildAt(0);
this.clipLoader.unload();
//this.removeChild(clipLoader);
}
}
Again, unloading a movie is a crucial part of Flash and Actionscripting. The lack of information out there on this is frightening.
PS the code above unloads the clip, but doesn’t destroy the clips timeline. I could simply stop the clip before unloading it. But I’m worried about that taking up too many resources.
Jake