You will get this error “ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller” when you call “unload()” method from Loader object if you have added/reparented its content like the code below:

?View Code ACTIONSCRIPT1
2
3
4
5
6
7
8
9
10
11
12
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
 
function onCompleteHandler(e:Event):void {
// Add loaded content to the display list
someMC.addChild(e.target.content);
 
// Call unload now, [...]

continue reading.....