# Problems with positioning dyn. attached buttons & centering loaded images \[renamed\]

**URL:** https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/60444
**Category:** flash
**Created:** [August 9, 2004, 10:52pm UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/60444 "2004-08-09T22:52:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Floppy](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@Floppy](https://forum.kirupa.com/u/Floppy)
#### Post date: [August 9, 2004, 10:52pm UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/60444/1 "2004-08-09T22:52:12Z")

</div>

this is a piece of my script…  
what it has to do is to generate “j” buttons (j being the number of registrations from my database) and arrange them in rows of 5 or 6…  
unfortunately the buttons are generated but are not arranged properly. i have 9 registrations in the database so there are 9 buttons… the first 8 are next to each other and the last one is somewhere to the right…

further on, at the release of a button it should create the lwLogo movieclip and load there a certain pic (the path being taken from my database). then the lwLogo mc should be centered on the screen… as this doesn’t happen in the \_root the center of the screen would be -442 in this movie clip so normally to center the image i should place lwLogo at -442-(lwLogo.\_width/2) but this doesn’t work. the photos are loaded but not in the center…

would anyone please take a look?  
thanks in advance

```auto
serie=0;
serii=0;
for(j=workEntries-1;j>=0; j--){
var mc = copyButton.duplicateMovieClip("copy"+j,j+10);
mc._x = (j-serii)*20;
if (mc._x>=120) {serie=serie+35; serii=serii+5} 
mc._y =(15 + serie);
mc.id = workSection.childNodes[j].childNodes[1];
mc.nr=j;
mc.onRelease = function(){
removeMovieClip(_root.lwLogo);
this.createEmptyMovieClip(lwLogo)
lwLogo._alpha=0;
		lwLogo.loadMovie(unescape(workSection.childNodes[this.nr].childNodes[2].firstChild.nodeValue));
			if (lwLogo.getBytesLoaded() == lwLogo.getBytesTotal()) {
			lwLogo._x=-442-(lwLogo._width/2);
				this.onEnterFrame = function() {if (lwLogo._alpha<=100) {
					lwLogo._alpha += 10;

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 11:27pm UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/60444/2 "2004-08-09T23:27:16Z")

</div>

anyone… please :_( :_( :\*(

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 11:56pm UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/60444/3 "2004-08-09T23:56:04Z")

</div>

i solved the first problem (with arranging the buttons) but i still can’t center the \*\*\*\* images…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 12:07am UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/60444/4 "2004-08-10T00:07:38Z")

</div>

well… i finally solved the problem 😃  
yupiiiiiiiiii

---

<div class="post-metadata">

### Author: ![DanD](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@DanD](https://forum.kirupa.com/u/DanD)
#### Post date: [April 19, 2006, 5:30pm UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/60444/5 "2006-04-19T17:30:42Z")

</div>

I can never seem to get answer from here. I have a few posts like yours. What did you do to have the image load in the center of the mc?
