# 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/118881
**Category:** Uncategorized
**Created:** [August 9, 2004, 10:52pm UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/118881 "2004-08-09T22:52:12Z")
**Posts on this page:** 4
**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/118881/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: ![Floppy](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@Floppy](https://forum.kirupa.com/u/Floppy)
#### Post date: [August 9, 2004, 11:27pm UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/118881/2 "2004-08-09T23:27:16Z")

</div>

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

---

<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, 11:56pm UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/118881/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: ![Floppy](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@Floppy](https://forum.kirupa.com/u/Floppy)
#### Post date: [August 10, 2004, 12:07am UTC](https://forum.kirupa.com/t/problems-with-positioning-dyn-attached-buttons-centering-loaded-images-renamed/118881/4 "2004-08-10T00:07:38Z")

</div>

well… i finally solved the problem 😃  
yupiiiiiiiiii
