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:
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.