No entiendo que parte de este código es el que no funciona.
El tema es que logro que me muestre 'letrero_mc', pero no el texto dinámico dentro de él:
'letrero_mc.cajaTexto_txt.html = true
letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0]
'
Aca les dejo el coódigo completo:
Código:
if (xmlorigen == undefined) { xmlorigen = "horoscopo.xml" } xmlHoroscopo = new XML () xmlHoroscopo.ignoreWhite = true xmlHoroscopo.onLoad = function (success) { _root.construirHoroscopo() } xmlHoroscopo.load(xmlorigen)
Código:
Agradeceria mucho me ayudaran a entender lo que estoy haciendo mal. Gracias. function construirHoroscopo () { for ( i = 0; i < 12; i++){ _root[xmlHoroscopo.firstChild.childNodes[i].nodeName + "Num"] = i } piscis_btn.onRelease = function () { n = s_piscisNum letrero_mc.gotoAndStop(2) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } escorpio_btn.onRelease = function () { n = s_escorpioNum letrero_mc.gotoAndStop(3) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } cancer_btn.onRelease = function () { n = s_cancerNum letrero_mc.gotoAndStop(4) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } libra_btn.onRelease = function () { n = s_libraNum letrero_mc.gotoAndStop(5) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } tauro_btn.onRelease = function () { n = s_tauroNum letrero_mc.gotoAndStop(6) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } leo_btn.onRelease = function () { n = s_leoNum letrero_mc.gotoAndStop(7) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } virgo_btn.onRelease = function () { n = s_virgoNum letrero_mc.gotoAndStop(8) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } aries_btn.onRelease = function () { n = s_ariesNum letrero_mc.gotoAndStop(9) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } capricornio_btn.onRelease = function () { n = s_capricornioNum letrero_mc.gotoAndStop(10) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } sagitario_btn.onRelease = function () { n = s_sagitarioNum letrero_mc.gotoAndStop(11) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } acuario_btn.onRelease = function () { n = s_acuarioNum letrero_mc.gotoAndStop(12) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } geminis_btn.onRelease = function () { n = s_geminisNum letrero_mc.gotoAndStop(13) letrero_mc.cajaTexto_txt.html = true letrero_mc.cajaTexto_txt.htmlText = "<font color='#FF00FF'>Amor: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[0].childNodes[0] + "\n" + "<font color='#FF00FF'>Amistad: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[1].childNodes[0] + "\n" + "<font color='#FF00FF'>Truco: </font>" + xmlHoroscopo.firstChild.childNodes[n].childNodes[2].childNodes[0] } }