Reliable Remove Child Method

Hello,

I’m new here. Mostly a design person. I’m struggling with removing externally loaded movies. I have a series of externally loading SWFs. On a button click Each movie reduces its alpha to zero, loads the next or previous movie, then unloads itself. I’ve tried putting the removeChild(this) code in a function, on its own line etc. The code works 2 or 3 times then the movies no longer remove themselves and just pile up. Is it unwise to to have a series of movies that load each other and remove themselves from the stage? Each movie has the same exact code for its previous and next buttons… Help! Here’s the code:

nextButt.addEventListener(MouseEvent.MOUSE_DOWN, nextCase);

function nextCase(event:MouseEvent):void{

var nextAplhaTween_1:Tween = new Tween(this, "alpha", Regular.easeIn, 1, 0, 2, true);


// load new movie
var caseDisplay_3:MovieClip;
var caseLoader:Loader = new Loader();
caseLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
caseLoader.load(new URLRequest("case_3.swf"));


function loaded(evt:Event):void {
	caseDisplay_3 = MovieClip(caseLoader.content);
	caseDisplay_3.x = 165;
	caseDisplay_3.y = 160;
	stage.addChild(caseDisplay_3);
}

MovieClip(this.parent).removeChild(this);

}

is that loaded function inside the nextCase function?
anyway, if you are just adding it to the stage, why dont you just use stage.removeChild()?

[QUOTE=johnlouis;2326409]is that loaded function inside the nextCase function?
anyway, if you are just adding it to the stage, why dont you just use stage.removeChild()?[/QUOTE]

Yeah it is inside the nextCase function. I think my basic problem was having this series of external SWFs load the next in series and then unload itself. They would sometimes work and sometimes not unload themselves. I’m thinking that was not the right approach so I’m putting the buttons that do the loading and unloading in the main movie. Now its a matter of getting strings that get updated to function adequately as instance names…

Thanks for the response!