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);
}