# Loading an external .swf and making it cache

**URL:** https://forum.kirupa.com/t/loading-an-external-swf-and-making-it-cache/326175
**Category:** flash
**Created:** [November 28, 2011, 9:31am UTC](https://forum.kirupa.com/t/loading-an-external-swf-and-making-it-cache/326175 "2011-11-28T09:31:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![iloveaphextwin](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@iloveaphextwin](https://forum.kirupa.com/u/iloveaphextwin)
#### Post date: [November 28, 2011, 9:31am UTC](https://forum.kirupa.com/t/loading-an-external-swf-and-making-it-cache/326175/1 "2011-11-28T09:31:50Z")

</div>

Hi there,

I have two flash files done in AS2. One is called ‘holder.swf’ and has the following code to load ‘ball\_game\_2\_10.swf’.

```auto

stop();

load_anim.load_fill._xscale = 0

loadMovie("ball_game_2_10.swf", "holder");

onEnterFrame = function () {
	infoLoaded = holder.getBytesLoaded();
	infoTotal = holder.getBytesTotal();
	percentage = Math.floor(infoLoaded/infoTotal*100);
	
	if (!isNaN(percentage) && percentage != null) {
		load_anim.load_fill._xscale = percentage;
	}
	
	if (percentage>=100 && !isNaN(percentage) && percentage != null) {
		delete onEnterFrame;
		
		load_anim._visible = false;
	}
};

```

For some reason every time you visit the link below, flash reloads the entire swf. How can I fix this so that it reloads only if the file is changed?

[http://www.gravityseasonsgreetings.com/xmas\_card/](http://www.gravityseasonsgreetings.com/xmas_card/)

Thanks

Will
