# Image preloader \*sigh\* (again)

**URL:** https://forum.kirupa.com/t/image-preloader-sigh-again/17309
**Category:** Uncategorized
**Created:** [April 3, 2003, 4:53pm UTC](https://forum.kirupa.com/t/image-preloader-sigh-again/17309 "2003-04-03T16:53:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![shuga](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@shuga](https://forum.kirupa.com/u/shuga)
#### Post date: [April 3, 2003, 4:53pm UTC](https://forum.kirupa.com/t/image-preloader-sigh-again/17309/1 "2003-04-03T16:53:15Z")

</div>

alright here’s the code

```php

this.createEmptyMovieClip("preloader", 1000);
this.createEmptyMovieClip("container", 1001);
with (container) {
        loadMovie(_root.picture);
        _x = 240;
        _y = -60;
        _xscale = 35;
        _yscale = 35;
        _visible = false;
}
preloader.onEnterFrame = function() {
        var l = container.getBytesLoaded();
        var t = container.getBytesTotal();
        var getPercent = l/t;
        loadText = Math.round(getPercent*100)+"%";
        loadBar._width = getPercent*160.5;
        if (l>0 && l>=t) {
                container._visible = 1;
                loadText = ""
                loadBar._visible = 0;

```

lostinbeta: i thought it was working yesterday but then it really wasn’t ☹ so i need help figuring out what’s wrong with it

the preloader shows like it’s supposed to for the first image. but when subsequent images are called then loaded, the preloader doesn’t show. yes i cleared my cache

--------------------edit-------------------  
you can see the problem at [http://www.aaronsleeper.com](http://www.aaronsleeper.com)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2003, 5:43pm UTC](https://forum.kirupa.com/t/image-preloader-sigh-again/17309/2 "2003-04-03T17:43:05Z")

</div>

:hangover:  
Well the text keeps showing and updating fine (but hard to see because of the color BTW)

But you never make your loadBar visible again, so that doesn’t show.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2003, 6:13pm UTC](https://forum.kirupa.com/t/image-preloader-sigh-again/17309/3 "2003-04-03T18:13:58Z")

</div>

right … i tried to make it visible again … that’s how i broke it yesterday … where do i put the code to say loadBar.\_visible = 1; ??

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2003, 8:31pm UTC](https://forum.kirupa.com/t/image-preloader-sigh-again/17309/4 "2003-04-03T20:31:57Z")

</div>

Put that on the code you use in your onPress so that when you press the button, the bar becomes visible again.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2003, 8:54pm UTC](https://forum.kirupa.com/t/image-preloader-sigh-again/17309/5 "2003-04-03T20:54:55Z")

</div>

genius … but it didn’t work ☹

in the on press function for the buttons i put designtext.loadBar.\_visible = 1;

but it didn’t work … it made the whole preloader invisible

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2003, 8:57pm UTC](https://forum.kirupa.com/t/image-preloader-sigh-again/17309/6 "2003-04-03T20:57:29Z")

</div>

Well that makes no sense. If you set something to be visible, then there is no reason that it would make the clip it is inside invisible.

There must be conflicting code in there somewhere.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2003, 8:59pm UTC](https://forum.kirupa.com/t/image-preloader-sigh-again/17309/7 "2003-04-03T20:59:21Z")

</div>

Also… you might want to take a look at Senoculars noCache prototype here…

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=14268&perpage=15&pagenumber=3](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=14268&perpage=15&pagenumber=3)

It would save you from having to clear your cache because if you add it to your loadMovie code that loads the .jpg image (shows how to use in thread) then it prevents it from getting cached.
