# attachMovie Problem

**URL:** <https://forum.kirupa.com/t/attachmovie-problem/51143>\
**Category:** flash\
**Created:** [May 10, 2004, 11:32am UTC](https://forum.kirupa.com/t/attachmovie-problem/51143 "2004-05-10T11:32:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarah012](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@sarah012](https://forum.kirupa.com/u/sarah012)\
**Post date:** [May 10, 2004, 11:32am UTC](https://forum.kirupa.com/t/attachmovie-problem/51143/1 "2004-05-10T11:32:10Z")

</div>

I am trying to write a function that will place a button on the screen for each object created froman array of XML nodes here is th code:

```auto
function buildContainerArray() {
			ContainerArray = new Array
			for (i=0; i<TitleNode.childNodes.length; i++){
				curContainer=TitleNode.childNodes*;
				ContainerArray* = new Container (curContainer.attributes.number, curContainer.attributes.name, curContainer.attributes.type);
			}
			makeContainer();
	}

	
	function makeContainer(){
		for (b=0; b<ContainerArray.length; b++){
			attachMovie("con_button", "selection"+b, b);
			_root["selection" + b]._x = 15;
			_root["selection" + b]._y = 90 + (i*30);
			trace ("worked");
		}
		eval ("selection" + b).onPress = function() {
			if (eval ("selection" + b).type_box.text="container") {
				trace ("this is a container");
			}else if (eval ("selection" + b).type_box.text="test") {
				trace ("this is a test");
			}
		}
	}

	function Container (numbers, names, types) {
		_root["selection" + b].number_box.text=numbers
		_root["selection" + b].names_box.text=names
		_root["selection" + b].type_box.text=types
		trace (numbers)
		trace (names)
		trace (types)
		}
}

```

Everything seems to work fine except the attach movie part. If anybody can see the problem I would really appreciate the help.
