# Center an image with createEmptyMovieClip

**URL:** <https://forum.kirupa.com/t/center-an-image-with-createemptymovieclip/248260>\
**Category:** flash\
**Created:** [January 6, 2008, 2:17am UTC](https://forum.kirupa.com/t/center-an-image-with-createemptymovieclip/248260 "2008-01-06T02:17:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmpstyles](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pmpstyles](https://forum.kirupa.com/u/pmpstyles)\
**Post date:** [January 6, 2008, 2:17am UTC](https://forum.kirupa.com/t/center-an-image-with-createemptymovieclip/248260/1 "2008-01-06T02:17:09Z")

</div>

Hello all,  
I am working on an image gallery and I have 2 questions.

#1  
Whether I use _createMovieClipLoader_ or just a _MovieClipLoader_ I have been unable to center my images.  
I have 12 thumbnails which are loaded dynamically via the loader component. Each of these thumbnail images have an _onRelease_ function which then loads a larger image into a larger movie clip on the same stage to the side. I used to use the loader component for this image as well, but have since added a progress bar and I couldn’t make it work with that. So the problem is that I have not been able to get the larger images to center when I release the thumbnail.  
I used the tutorial from Kirupa that shows how to make a progress bar for my needs [[COLOR=#cc6600]http://www.kirupa.com/developer/act…ecliploader.htm[/COLOR]](http://www.kirupa.com/developer/actionscript/moviecliploader.htm), but it uses one image size. I am useing both landscape and portrait images for the big movie clip. This tutorial works with \*createMovieClipLoader. \*This is fine except, if I set the x & y coordinates the image opens from those coordinates and the portrait images are then off center.  
I then manipulated the code from the previous tutorial to work with just \*MovieClipLoader \*which I created on the stage so that I could use the convert to symbol for access to the registration position. Athough I was able to change the registration position, I was still left with the same senario as the images were off center.  
Does anyone know how to center landscape and portrait shaped images into a movie clip?

#2  
I also would like to kow if anyone knows how to make text a button for previous and next buttons? I just want text and no image or outline, mayb a drop shadow.

Thanks for your time, ~Ernie

**Code:**  
///////BigScreen Preloader///////  
[COLOR=#000050]bar[/COLOR].[COLOR=#0000d0]\_visible[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#006610]false[/COLOR]; [COLOR=#0000d0]border[/COLOR].[COLOR=#0000d0]\_visible[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#006610]false[/COLOR]; [COLOR=#006610]var[/COLOR] [COLOR=#000050]empty[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#0000d0]this[/COLOR].[COLOR=#0000d0]createEmptyMovieClip[/COLOR][COLOR=#0000ff]([/COLOR][COLOR=#666666]“container”[/COLOR], [COLOR=#666666]“100”[/COLOR][COLOR=#0000ff])[/COLOR];  
[COLOR=#000050]empty[/COLOR].[COLOR=#0000d0]\_x[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#991010]0[/COLOR]; [COLOR=#000050]empty[/COLOR].[COLOR=#0000d0]\_y[/COLOR] [COLOR=#0000ff]=[/COLOR] [COLOR=#991010]0[/COLOR];  
my\_mc = new MovieClipLoader();  
preload = new Object();  
my\_mc.addListener(preload);  
preload.onLoadStart = function(targetMC) {  
trace(“started loading”+targetMC);  
container.\_visible = false;  
bar.\_visible = true;  
border.\_visible = true;  
pText.\_visible = true;  
};  
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {  
bar.\_width = (lBytes/tBytes)\*415;  
pText.text = Math.round((lBytes/tBytes)\*100)+"%";  
};  
preload.onLoadComplete = function(targetMC) {  
container.\_visible = true;  
border.\_visible = false;  
bar.\_visible = false;  
pText.\_visible = false;  
trace(targetMC+“finished”);  
};

///////Default Loaded Image///////  
my\_mc.loadClip(“M\_0001.JPG”, “container”);

///////Thumbnails to BigScreen///////  
img\_0001.onRelease = function() {  
my\_mc.loadClip(“M\_0001.JPG”, “container”);  
};
