hi,

other problem...
i'm fighting hard with as3....

i created a list of textfields as a child each one... from a xml file.
what i realy want as result of this.... is create a menu with this list... and each text field when clicked invoke specific function that must use some parameters from the respective node in tha xml file too....

i have the array cursos[..] (each one respects to a new created child)


A PIECE OF THE CODE FOR EXAMPLE
cursosTeatroXML = new XML(e.target.data);
var cursos:Array = new Array();

for (var c:int = 0; c<cursosTeatroXML.CURSO.length(); c++) {

cursos[c] = new TextField();
cursos[c].text = cursosTeatroXML.CURSO[c].DESIGNACAO;
cursos[c].width = 165;
cursos[c].selectable = false;
cursos[c].x = 0;
cursos[c].y = 30+12*c;
cursos[c].name = 'opcaoteatro';
cursos[c].addEventListener(MouseEvent.CLICK, mostraHorario);

addChild(cursos[c]);

function mostraHorario() {
trace (cursosTeatroXML.CURSO[c].DIAS);
}
}

};

SO the problem is that into the fucntion mostraHorario() i can't reference the XML node needed... also associated to the cursos[c] array item. Even i can pass tha value of 'c' into the function... its value will be tha last one of the for() loop.... and not the respective to the child clicked.

i'm dispairing width this during too much hours.... trying so many possible solutions... but nothing works...

thanks.