# Removing temporary cache files using flash

**URL:** https://forum.kirupa.com/t/removing-temporary-cache-files-using-flash/299738
**Category:** Uncategorized
**Created:** [November 10, 2009, 12:50pm UTC](https://forum.kirupa.com/t/removing-temporary-cache-files-using-flash/299738 "2009-11-10T12:50:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vjn\_23](https://avatars.discourse-cdn.com/v4/letter/v/9de0a6/32.png) [@vjn\_23](https://forum.kirupa.com/u/vjn_23)
#### Post date: [November 10, 2009, 12:50pm UTC](https://forum.kirupa.com/t/removing-temporary-cache-files-using-flash/299738/1 "2009-11-10T12:50:20Z")

</div>

Hi Friends,

I am using Flash CS3. Now i am using this code…

var intervalID:Number;  
this.createEmptyMovieClip(“myMovie”,this.getNextHighestDepth());  
this.createEmptyMovieClip(“progressMovie”,this.getNextHighestDepth());  
progressMovie.\_x = 60;  
progressMovie.\_y = 120;  
progressMovie.createTextField(“percentDoneLabel”,progressMovie.getNextHighestDepth(),40,0,100,20);  
myMovie.loadMovie(“[http://www.nathanderksen.com/book/trailer.swf](http://www.nathanderksen.com/book/trailer.swf)”);  
intervalID = setInterval(monitorProgress, 100);  
function monitorProgress():Void {  
var percentDone:Number;  
myMovie.stop();  
myMovie.\_visible = false;  
if (myMovie.getBytesLoaded()\>0) {  
percentDone = myMovie.getBytesLoaded()/myMovie.getBytesTotal()\*100;  
showProgress(percentDone);  
trace(“percentDone: “+percentDone);  
if (myMovie.getBytesTotal() == myMovie.getBytesLoaded()) {  
clearInterval(intervalID);  
myMovie.play();  
myMovie.\_visible = true;  
progressMovie.\_visible = false;  
trace(“Content has finished loading.”);  
}  
}  
}  
function showProgress(percentDone:Number):Void {  
var barWidth:Number = percentDone;  
progressMovie.percentDoneLabel.text = String(Math.ceil(percentDone))+” %”;  
progressMovie.clear();  
// Draw a border  
progressMovie.moveTo(0,20);  
progressMovie.lineStyle(1,0x666666);  
progressMovie.lineTo(100,20);  
progressMovie.lineTo(100,30);  
progressMovie.lineTo(0,30);  
progressMovie.lineTo(0,20);  
// Draw the bar  
progressMovie.moveTo(0,20);  
progressMovie.beginFill(0xCCCCCC,100);  
progressMovie.lineTo(barWidth,20);  
progressMovie.lineTo(barWidth,30);  
progressMovie.lineTo(0,30);  
progressMovie.lineTo(0,20);  
progressMovie.endFill();  
}

now what my problem is, first time using this script successfully its running, and showing preloader text. But another time using this script (press Ctrl + Enter) that time cache files are running, so the preloader text doesnt showing not properly. So how can i remove the cache files using flash…

regards,

Vijayan M
