Comunidad de diseño web y desarrollo en internet online

Problema cargando links de XML desde Flash (undefined)

Citar            
MensajeEscrito el 14 Abr 2009 07:24 pm
Hola! muchas gracias desde ya por leer mi problema.
Les cuento, tengo un xml con links, que lo lee un swf insertado en un js que esta en un asp.

Probando desde flash, los links los carga bien y me lleva a la url que el xml dice, pero cuando lo inserto en el sitio, al clickear, aparece undefined y no me carga el link. Les paso los códigos:


XML

Código :

<friends>
<friend url="http://www.link1.com">Foto1</friend>
<friend url="http://www.link2.com">Foto2</friend>
<friend url="http://www.link3.com">Foto3</friend>
<friend url="http://www.link4.com">Foto4</friend>
<friend url="http://www.link5.com">Foto5</friend>
</friends>



Código flash en el primer frame

Código :

var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = parseXML;
myXML.load("linksfriends.xml");

function parseXML()
{
text1.txt.text = myXML.firstChild.childNodes[0].firstChild.nodeValue;
text1.strURL = myXML.firstChild.childNodes[0].attributes.url;
text2.txt.text = myXML.firstChild.childNodes[1].firstChild.nodeValue;
text2.strURL = myXML.firstChild.childNodes[1].attributes.url;
text3.txt.text = myXML.firstChild.childNodes[2].firstChild.nodeValue;
text3.strURL = myXML.firstChild.childNodes[2].attributes.url;
text4.txt.text = myXML.firstChild.childNodes[3].firstChild.nodeValue;
text4.strURL = myXML.firstChild.childNodes[3].attributes.url;
text5.txt.text = myXML.firstChild.childNodes[4].firstChild.nodeValue;
text5.strURL = myXML.firstChild.childNodes[4].attributes.url;

text1.onPress = function()
{
   getURL(this.strURL);
}
text2.onPress = function()
{
   getURL(strURL);
}

text3.onPress = function()
{
   getURL(strURL);
}

text4.onPress = function()
{
   getURL(strURL);
}

text5.onPress = function()
{
   getURL(strURL);
}

}



y en cada botón

Código :

on (press) {
   getURL(text1.strURL);
}


Estoy hace varios días, si cargo el link del swf funciona bien, pero no en el asp.

Gracias!
Besos!

Por estefig

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 15 Abr 2009 11:33 am
Posiblemente el html que contiene el swf no esté en la misma carpeta, entonces la ruta al XML cambia y no lo encuentra. Cambia la ruta como si fuera desde el asp

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 16 Abr 2009 08:32 pm
Si! Era eso!!
Muchsiiiiiisiiiimas gracias! Me salvaste!!

Por estefig

1 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.