Centralising external .jpg file in a emptyMovieClip

anyone noe how to do this…?

say i got this empty movie clip which loads .jpg files… the dimensions of the empty movie clip is 800 by 550…

by default, the top most left of the external .jpg image will load onto the 0 by 0 point of the movie clip… but i want it to display the .jpg image in the center of the empty movie clip…

my guess is i have to get the dimensions of the external .jpg and then calculate from there… anyone has done this and would kind enough to share his/her code…?

advice and suggestions needed… TIA… :s:

try to change your movieclip’s center position to top left corner.
u can do it when you creating new movieclip,
there is an option something like “Register Positon”… choose the top-left corner.

PS. this can be made with AS but i think try to do this first.

try this:
myJpgHolder._x = (800 - myJpgHolder._width)/2;
myJpgHolder._y = (550 - myJpgHolder._height)/2;

that will center it for you, all you have to do is make sure the picture is loaded before you try to do that otherwise it won’t work, you could do this:

if(myJpgHolder._width){
myJpgHolder._x = (800 - myJpgHolder._width)/2;
myJpgHolder._y = (550 - myJpgHolder._height)/2;
}

and that will work as long as the width is something other than 0 or undefined, in other words the picture is loaded.