Hola otra vez... adjunto una copia del código que utilizo para ver si alguien ve donde está el fallo (el fallo gordo, ya sé que en general no está muy elegante la cosa)
naranja="0xEA9334";
azul="0x01617A";
function loadXML(loaded) {
if (loaded) {
totalpasos=this.childNodes.length;
paso=[];
for (n=0; n<totalpasos; n++) {
xmlNode = this.childNodes[n];
paso[n]={nombre : xmlNode.attributes.nombre,
pregunta : [],
respuesta : [],
texto: xmlNode.firstChild.firstChild.nodeValue,
total: xmlNode.childNodes[1].childNodes.length,
texto_car:xmlNode.childNodes[2].firstChild.nodeValue,
texto_form:xmlNode.childNodes[3].firstChild.nodeValue};
for (i=0; i<paso[n].total; i++) {
paso[n].pregunta[i]={enunciado:"",carencia:"",formacion:""};
paso[n].pregunta[i].enunciado = i+1 +". "+xmlNode.childNodes[1].childNodes[i].childNodes[0].firstChild.nodeValue;
paso[n].pregunta[i].carencia=xmlNode.childNodes[1].childNodes[i].childNodes[1].firstChild.nodeValue;
paso[n].pregunta[i].formacion=xmlNode.childNodes[1].childNodes[i].childNodes[2].firstChild.nodeValue;
}
}
current_paso=0;
printpreg(current_paso);
result(0);
} else {
content = "Error en la carga de Datos";
}
}
function result(paso_num){
pos_y=0;
ancho=700;
n=1;
formatotexto_car = new TextFormat();
formatotexto_car.font = "fuente";
formatotexto_car.size=12;
formatotexto_car.color="0x000000";
formatotexto_form = new TextFormat();
formatotexto_form.font = "fuente";
formatotexto_form.size=12;
formatotexto_form.color=azul;
formatocarencias = new TextFormat();
formatocarencias.font = "fuente";
formatocarencias.size=12;
formatocarencias.color=naranja;
formatocarencias.blockIndent=30;
formatoformacion = new TextFormat();
formatoformacion.font = "fuente";
formatoformacion.size=12;
formatoformacion.color="0x000000";
formatoformacion.blockIndent=30;
//texto carencias
_root.resultados.createTextField("texto_car",n,0,pos_y,ancho,200);
with(_root.resultados.texto_car){
selectable=false;
multiline=true;
wordWrap=true;
autosize = "left";
text=paso[paso_num].texto_car+"\n"+"\n";
setTextFormat(formatotexto_car);
embedFonts=true;
}
pos_y+=_root.resultados.texto_car._height;
n++;
//Carencias
texto_temp="";
for (i=0;i<paso[paso_num].total;i++){
if (paso[paso_num].respuesta[i]<50){
texto_temp+="· ";
texto_temp+=paso[paso_num].pregunta[i].carencia;
texto_temp+="\n";
}
}
_root.resultados.createTextField("carencias",n,0,pos_y,ancho,200);
with(_root.resultados.carencias){
selectable=false;
multiline=true;
wordWrap=true;
autosize = "left";
text=texto_temp+"\n";
setTextFormat(formatocarencias);
embedFonts=true;
}
pos_y+=_root.resultados.carencias._height;
n++;
//texto Formación
_root.resultados.createTextField("texto_form",n,0,pos_y,ancho,200);
with(_root.resultados.texto_form){
selectable=false;
multiline=true;
wordWrap=true;
autosize = "left";
text=paso[paso_num].texto_form+"\n"+"\n";
setTextFormat(formatotexto_form);
embedFonts=true;
}
pos_y+=_root.resultados.texto_form._height;
n++;
//Formación
texto_temp="";
for (i=0;i<paso[paso_num].total;i++){
if (paso[paso_num].respuesta[i]<50){
texto_temp+="· ";
texto_temp+=paso[paso_num].pregunta[i].formacion;
texto_temp+="\n";
}
}
_root.resultados.createTextField("formacion",n,0,pos_y,ancho,200);
with(_root.resultados.formacion){
selectable=false;
multiline=true;
wordWrap=true;
autosize = "left";
text=texto_temp+"\n";
setTextFormat(formatoformacion);
embedFonts=true;
}
pos_y+=_root.resultados.carencias._height;
}
_root.inicio=0;
_root.alto=20;
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("archivos/data.xml");
Hasta aquí todo bien, se puede ver el resultado en
http://el-laboratori.com/coepa/a1.swfpero si añado a la pelicula un ScrollPane, le nombro "sp_p" y escribo
sc_p.setScrollContent(_root.resultados);
justo al final de la función result me aparece esto
http://el-laboratori.com/coepa/a2.swf¿alguien tiene alguna idea?