# Loading JPG from different frame

**URL:** <https://forum.kirupa.com/t/loading-jpg-from-different-frame/210522>\
**Category:** Uncategorized\
**Created:** [December 19, 2006, 6:06pm UTC](https://forum.kirupa.com/t/loading-jpg-from-different-frame/210522 "2006-12-19T18:06:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samroni](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@samroni](https://forum.kirupa.com/u/samroni)\
**Post date:** [December 19, 2006, 6:06pm UTC](https://forum.kirupa.com/t/loading-jpg-from-different-frame/210522/1 "2006-12-19T18:06:00Z")

</div>

Hi guys, i got a quick question regarding moviecliploader.

i just knew that when you loadMovie some external JPG. it isn’t cached in memory. so when you call the JPG again, you will reload it.

then i got answer from [here](http://blog.madarco.net/26/strange-flash-cache-behaviour-and-attachmovieanywhere-solution/) saying that by using [COLOR=#0066cc]MovieClipLoader[/COLOR], you don’t have to waste bandwidth and call the JPG from memory.

here’s quote from the website: “So I can load it everywhere I need it without using any bandwidth. In this way I can attach the loaded resources everywhere in the movie.”

=========================================

now the study case for me. i need help with this please.

- i want to load a JPG in frame 5.
- then i want to preload the jpg in frame 1.

the reason behind it is simply i want to load the jpg first, then view jpg later without dl it first.

the code i use:

* * *

frame1\*\*  
item is empty movie clip  
load\_text is empty textfield  
total\_text is empty textfield\*

```auto

item._visible = false;
item_loader = new MovieClipLoader();
item_loader.addListener(this);
item_loader.loadClip("xml/home/home.jpg", item);

this.onEnterFrame = function() {
   if (item.getBytesLoaded()/item.getBytesTotal()*100 == 100) {
        gotoAndStop("home");
        delete this.onEnterFrame;
    }
    
    load_text.text = item.getBytesLoaded();
    total_text.text = item.getBytesTotal();
};

```

now how can i call home.jpg in frame 5 without reloading it ?

thx for all your help 😃 appreciate it…
