I have images loading from an array. A slideshow. This works fine, but they pile on top of each other. I cannot figure out how to remove them. what's the simplest way to remove them? How do I say - if pic1 is loaded, before loading pic2, remove pic1?
Thanks.
Code:var aPics:Array=new Array("pic1.jpg","pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg"); var threeSeconds:Timer=new Timer(3000,aPics.length); threeSeconds.start(); function slideShow(evt:TimerEvent):void { var picLoader:Loader = new Loader(); picLoader.load(new URLRequest(aPics[evt.target.currentCount-1])); picLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete); } function loadComplete(evt:Event):void { var image:Bitmap=Bitmap(evt.target.content); image.x=209; image.y=134; addChild(image); } threeSeconds.addEventListener(TimerEvent.TIMER, slideShow);




Reply With Quote
