# \[Q\] Preloader help: making sure image is FULLY loaded

**URL:** https://forum.kirupa.com/t/q-preloader-help-making-sure-image-is-fully-loaded/192230
**Category:** flash
**Created:** [June 27, 2006, 5:18am UTC](https://forum.kirupa.com/t/q-preloader-help-making-sure-image-is-fully-loaded/192230 "2006-06-27T05:18:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![shell2006](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@shell2006](https://forum.kirupa.com/u/shell2006)
#### Post date: [June 27, 2006, 5:18am UTC](https://forum.kirupa.com/t/q-preloader-help-making-sure-image-is-fully-loaded/192230/1 "2006-06-27T05:18:26Z")

</div>

\<disclaimer\> I have to make a Flash 6 gallery so I can’t use MCL \</disclaimer\>

There are times when the jpg that is getting loaded doesn’t center correctly. I have done everything that I can think of to check to make sure that it is fully loaded before I try to center it. Here is my code:  
[FONT=Courier New][LEFT]

```auto

function preloader(num:Number):Void {
    picture_mc.loadMovie(images[num]);
    preloader_mc._visible = false;
    onEnterFrame = function () {
        var l:Number = picture_mc.getBytesLoaded();
        var t:Number = picture_mc.getBytesTotal();
        var per:Number = Math.round(l/t*100);
        if (per>0) {
            preloader_mc._visible = true;
            preloader_mc.gotoAndStop(per);
            test_txt.text = "running";
        }
        if (t>4 && picture_mc._width>0 && picture_mc._height>0) {
            test_txt.text = "pictured centered";
            delete this.onEnterFrame;
            preloader_mc._x = -1000;
            preloader_mc._visible = false;
            picture_mc._x = BG_mc._x+(BG_mc._width/2)-(picture_mc._width/2);
            picture_mc._y = BG_mc._y+(BG_mc._height/2)-(picture_mc._height/2);
        }
    };
}

```

[/LEFT]  
[/FONT] [FONT=Courier New][LEFT][COLOR=#000000] [/COLOR][/LEFT]  
[/FONT] Do you have any theories why the clip will not center correctly?

Ideas?

🙂
