# Centering JPG's when using loadMovie

**URL:** https://forum.kirupa.com/t/centering-jpgs-when-using-loadmovie/174873
**Category:** flash
**Created:** [January 10, 2006, 1:19am UTC](https://forum.kirupa.com/t/centering-jpgs-when-using-loadmovie/174873 "2006-01-10T01:19:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bubbapuck](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@bubbapuck](https://forum.kirupa.com/u/bubbapuck)
#### Post date: [January 10, 2006, 1:19am UTC](https://forum.kirupa.com/t/centering-jpgs-when-using-loadmovie/174873/1 "2006-01-10T01:19:10Z")

</div>

I have done some searching on my problem and found some discussion but no direct answer. I have a slide show flash movie that is using actionscript and loadMovie to load a set of jpgs in. My problem is the jpgs are various sizes and I need to have them centered in the movie clip they are loading to. Below is my actionscript. Can anyone help me center the loading jpgs?  
Thanks… Bubba

\_root.onLoad = function() {  
currElement = 0;  
picDataLoad = new LoadVars();  
arrPics = new Array();  
arrText = new Array();  
folder = “images/”; // Path where photos are.  
// folder = “”; // Testing Only.  
picDataLoad.load(“century-productions.txt”); // Load data from text file.  
picDataLoad.onLoad = function(success) {  
if (success) {  
arrPics = picDataLoad.pic.split(",");  
arrText = picDataLoad.text.split(",");  
galleryTitle = picDataLoad.title;  
galleryText = arrText[0];  
picPath = folder+arrPics[0];  
loadMovie(picPath, “\_root.mcPhoto”);  
}  
}  
}  
\_root.next\_btn.onRelease = function() {  
if (currElement \< arrPics.length - 1) {  
++currElement;  
picPath = folder+arrPics[currElement];  
trace(picPath);  
loadMovie(picPath, “\_root.mcPhoto”);  
galleryText = arrText[currElement];  
} else {  
currElement = 0;  
picPath = folder+arrPics[currElement];  
loadMovie(picPath, “\_root.mcPhoto”);  
galleryText = arrText[currElement];  
}  
}  
\_root.prev\_btn.onRelease = function() {  
if (currElement == 0) {  
currElement = arrPics.length - 1;  
picPath = folder+arrPics[currElement];  
loadMovie(picPath, “\_root.mcPhoto”);  
galleryText = arrText[currElement];  
} else {  
–currElement;  
picPath = folder+arrPics[currElement];  
loadMovie(picPath, “\_root.mcPhoto”);  
galleryText = arrText[currElement];  
}  
}
