# Load image position problem

**URL:** <https://forum.kirupa.com/t/load-image-position-problem/319483>\
**Category:** flash\
**Created:** [February 22, 2011, 8:51am UTC](https://forum.kirupa.com/t/load-image-position-problem/319483 "2011-02-22T08:51:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lillo\_\_hotmail](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lillo\_\_hotmail](https://forum.kirupa.com/u/lillo__hotmail)\
**Post date:** [February 22, 2011, 8:51am UTC](https://forum.kirupa.com/t/load-image-position-problem/319483/1 "2011-02-22T08:51:16Z")

</div>

Hi all!

I’m trying to load an image with the following code but sometimes the image wont end up in the right place. Can someone understand why?

var exampleHolder = exampleLoader\_mc.attachMovie(“exampleLoaderHolder\_mc”,“example”,1)  
exampleHolder.loadMovie(\_root.publicExampleToLoad)  
this.onEnterFrame = function()  
{  
filesize = exampleHolder.getBytesTotal();  
loaded = exampleHolder.getBytesLoaded();  
if(loaded == filesize)  
{  
var imgHeight = exampleLoader\_mc.\_height  
var imgWidth = exampleLoader\_mc.\_width  
exampleHolder.\_x = (950/2)-(imgWidth/2)  
exampleHolder.\_y = (600/2)-(imgHeight/2)  
delete this.onEnterFrame  
play()  
}  
}

Have a great day!
