# How to prevent newly preloading

**URL:** <https://forum.kirupa.com/t/how-to-prevent-newly-preloading/164331>\
**Category:** flash\
**Created:** [September 30, 2005, 7:53am UTC](https://forum.kirupa.com/t/how-to-prevent-newly-preloading/164331 "2005-09-30T07:53:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jankratochvil](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jankratochvil/32/566_2.png) [@jankratochvil](https://forum.kirupa.com/u/jankratochvil)\
**Post date:** [September 30, 2005, 7:53am UTC](https://forum.kirupa.com/t/how-to-prevent-newly-preloading/164331/1 "2005-09-30T07:53:00Z")

</div>

I have small problem.  
I tried to apply ProgressBar component to my new site which is in development.  
If this site loads [http://kameny.bresco.cz](http://kameny.bresco.cz/default_bresco_high1.htm) You see 2 ProgressBars which display loading of 2 images.

Problem is if the user click whatever of menu above (castillo, colorado, etc.) and than will again display the start page (click on logo BRESCO), than is the preloading newly displayed even if the images was loaded before.  
I use this code:

```auto

var my_pb:mx.controls.ProgressBar;
//Set progress bar mode
my_pb.mode = "manual";
//my_pb.label = "%1% ze %2% nahráno";
//minimum numerical value before progress bar increments
my_pb.minimum = 100;
//maximum value of progress bar before it stops
my_pb.maximum = 200;
var increment_num:Number = my_pb.minimum;
this.onEnterFrame = function() {
	if (increment_num<my_pb.maximum) {
		increment_num++;
		//update progress of number incrementing
		my_pb.setProgress(increment_num, my_pb.maximum);
		trace(increment_num);
	} else {
// go to the second frame to display image		
gotoAndStop(2);
		delete this.onEnterFrame;
	}
};

```

I cant fix it, can you help me?  
Thanks
