# Does Flash have an internal cache or something?

**URL:** <https://forum.kirupa.com/t/does-flash-have-an-internal-cache-or-something/251142>\
**Category:** flash\
**Created:** [February 5, 2008, 7:13pm UTC](https://forum.kirupa.com/t/does-flash-have-an-internal-cache-or-something/251142 "2008-02-05T19:13:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aneurin\_Mark\_II](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/aneurin_mark_ii/32/1564_2.png) [@Aneurin\_Mark\_II](https://forum.kirupa.com/u/Aneurin_Mark_II)\
**Post date:** [February 5, 2008, 7:13pm UTC](https://forum.kirupa.com/t/does-flash-have-an-internal-cache-or-something/251142/1 "2008-02-05T19:13:53Z")

</div>

I have a Flash object running on an (online) webpage that imports an AS file like so:

[AS]import load\_background.lb;  
var loadbackground:lb = new lb;  
this.addChild (loadbackground.load\_background(this.loaderInfo.parameters.time\_of\_day));[/AS]

To clarify, the load\_background function returns a background image based a ‘time of  
day’ variable given in FlashVars. This image is an absolute address, based on a root directory given as a variable in the function.

Here’s the AS:

[AS]// Add background depending on var given.

package load\_background {  
public class lb {  
import flash.display.Loader;  
import flash.net.URLRequest;  
import flash.display.DisplayObject;  
public function load\_background (time\_of\_day:String):DisplayObject {  
var rootpath:String = ‘[http://www.domain.com/dir/](http://www.domain.com/dir/)’;  
var background\_path:String = rootpath + ‘template/pics/’ + time\_of\_day + ‘/flashbg.jpg’;  
var request:URLRequest = new URLRequest(background\_path);  
var loader:Loader = new Loader;  
loader.load (request);  
var bgimage:DisplayObject = loader;  
return bgimage;  
}  
}  
}[/AS]

([domain.com/dir](http://domain.com/dir) above substitutes the actual web address since I don’t want to share the work yet.)

Now this works fine on my own computer, but on no other computers I run it on. Upon investigating the issue in Safari, I find this is because, for some reason, and despite the domain being correctly set in the rootpath variable, it loads the background image from my local testing server.

```auto
http://www.domain.com/dir/content/movie.swf?time_of_day=day
> http://localhost/dir/template/pics/day/flashbg.jpg

```

If I change the background\_path string so that it should attempt to load a totally random and nonexistent file, it _still_ loads the same file from my local server. If, for instance, I change rootpath so that it is [http://www.domain.com/dir/\*\*\*\*\*\*\*\*.jpg](http://www.domain.com/dir/ ********.jpg), it STILL attempts to load [http://localhost/dir/template/pics/day/flashbg.jpg](http://localhost/dir/template/pics/day/flashbg.jpg). WHAT??

It appears that the Flash movie is completely ignoring my AS file; I don’t understand why. This can’t possibly make sense since it requires the AS file in the first place to load any image. I honestly cannot in the slightest fathom what the \*\*\*\* is wrong with this. _ANYTHING_ anyone can contribute that sheds light on the matter would be unquantifiably appreciated.
