# Change spacing of dynamically placed objects

**URL:** <https://forum.kirupa.com/t/change-spacing-of-dynamically-placed-objects/259793>\
**Category:** Uncategorized\
**Created:** [May 8, 2008, 7:12pm UTC](https://forum.kirupa.com/t/change-spacing-of-dynamically-placed-objects/259793 "2008-05-08T19:12:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaderist](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vaderist](https://forum.kirupa.com/u/vaderist)\
**Post date:** [May 8, 2008, 7:12pm UTC](https://forum.kirupa.com/t/change-spacing-of-dynamically-placed-objects/259793/1 "2008-05-08T19:12:03Z")

</div>

I am placing 6 images on the stage using a for loop as such:

```auto
for (var i:uint = 0; i < 6; i++)
{
	var padding:uint = 15;
	var imageX:uint = 0;
	image = new Image();
	image.x = imageX;

	container.addChild(image);
				
	imageX += image.width + padding;
}

```

Then using MouseEvents I make each image grow on MOUSE\_OVER and shrink back on MOUSE\_OUT. I would like to maintain the spacing (padding) in between the scaled image and the image on either side.

How do I target each image when they are created with identical identifiers?
