### Handling Loader Unload Events in Child SWF Source: https://github.com/greensock/greensock-as3/blob/master/src/com/greensock/loading/changelog.txt This snippet demonstrates how a child SWF can listen for the LoaderEvent.UNLOAD event to perform cleanup. This is useful for managing stage event listeners, sounds, or NetStreams to prevent memory leaks. ```ActionScript var curParent:DisplayObjectContainer = this.parent; while (curParent) { if (curParent.hasOwnProperty("loader")) { Object(curParent).loader.addEventListener("unload", dispose, false, 0, true); } curParent = curParent.parent; } function dispose(event:Event):void { //cleanup code here... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.