Foros del Web » Creando para Internet » Flash y Actionscript »

problema con el load()

Estas en el tema de problema con el load() en el foro de Flash y Actionscript en Foros del Web. Hola a todos... como veran soy nuevo en la comunidad. tube la gran necesidad de pedir su ayuda ya q no me corre bien mi ...
  #1 (permalink)  
Antiguo 20/02/2009, 22:06
 
Fecha de Ingreso: febrero-2009
Mensajes: 15
Antigüedad: 15 años, 1 mes
Puntos: 0
problema con el load()

Hola a todos... como veran soy nuevo en la comunidad. tube la gran necesidad de pedir su ayuda ya q no me corre bien mi flash!

el problema es con mi load cuando el archivo XML esta en el misma carpeta con el SWF si lo lee sin ingun problema,

pero si mi XML esta en otro dominio (servidor) o por último esta en otra carpeta ya no lee el load y toda las variables me sale como undefined quisiera una mano de ustedes.

por favor junten toda las partes de una URL lo tuve q separar por motivos anti-spam que la web maneja ;)

un ejemplo de un XML puede ser:

obj_xml.load("http :// xml . djuego . com / games/ the_maze");

Código:
obj_xml = new XML();
obj_xml.ignoreWhite = true;
obj_xml.load("http :// xml . djuego . com / games / " + _root.ID);
obj_xml.onLoad = mx.utils.Delegate.create(this, onLoadXml);
function onLoadXml(exito) {
		var gameWidth;
        var gameHeight;
        var strName;
        var strGameUrl;
		var strIconUrl;
		var myBODYTEXT;
		gameWidth = obj_xml.firstChild.childNodes[4].firstChild.nodeValue;
		gameHeight = obj_xml.firstChild.childNodes[5].firstChild.nodeValue;
		strName = obj_xml.firstChild.childNodes[2].firstChild.nodeValue;
		myBODYTEXT = obj_xml.firstChild.childNodes[3].firstChild.nodeValue;
		strGameUrl = obj_xml.firstChild.childNodes[1].firstChild.nodeValue;
		strIconUrl = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
		strLogoWeb = obj_xml.firstChild.childNodes[6].firstChild.nodeValue;
		gameWidth = Stage.width;
		gameHeight = Stage.height;
		setProperty("", _x, int((590 - gameWidth) / 2));
		setProperty("", _y, int((400 - gameHeight) / 2));
		function playGame()
		{
			_root.loadMovie(strGameUrl);
			loadVariables("http :// www . djuego . com / apis / reproduccion ? id =" + _root.ID, this);
		}
		contenidoBODY.bodyGAME.text = myBODYTEXT;
		txtGameName.text = strName;
		InstanceName_0._x = 10;
		InstanceName_0._y = 10;
		InstanceName_0._width = gameWidth - 20;
		InstanceName_0._height = gameHeight - 20;
		mcWhiteBg._width = gameWidth;
		mcWhiteBg._height = gameHeight;
		mcWhiteBg._x = 0;
		mcWhiteBg._y = 0;
		var counter = 0;
		
		var txtGameName;
		txtGameName.autoSize = true;
		var f = new TextFormat();
		f.size = 20;
		var counter = 0;
		while (txtGameName._width > Stage.width - 20)
		{
			++counter;
			f.size = f.size - counter;
			txtGameName.setNewTextFormat(f);
			txtGameName.text = strName;
		}
		btnMiniclip.loadMovie(strLogoWeb);
		mcPlay.mcIcon.loadMovie(strIconUrl);
		txtGameName._y = mcPlay._y / 2 - txtGameName._height / 2 + 5;
		txtGameName._x = gameWidth / 2 - txtGameName._width / 2;
		mcBtnPlay.onRelease = function ()
		{
   		 	playGame();
		};
		/*InstanceName_0.onRelease = function ()
		{
   		 	playGame();
		};*/
		mcDotty.setSize(int(gameWidth) - 40, 1);
		mcDotty._x = 20;
		mcDotty._y = int(gameHeight - 57);
		btnDJuegoGO.onRelease = function ()
		{
   			 getURL("http :// www . djuego . com ");
		};
		
};
stop ();

no se en que pueda esta fallando
  #2 (permalink)  
Antiguo 20/02/2009, 23:08
Avatar de jahepi
Colaborador
 
Fecha de Ingreso: diciembre-2004
Ubicación: Querétaro
Mensajes: 1.124
Antigüedad: 19 años, 4 meses
Puntos: 43
Respuesta: problema con el load()

Hola christiancarlos !

Date una vuelta al siguiente artículo:
http://blog.unijimpe.net/utilizar-crossdomainxml/

Un saludote !
__________________
Una contraseña es como la ropa interior. No deberías dejarlas afuera a la vista de otras personas, deberías cambiarla regularmente, y ni se te ocurra prestarla a extraños.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:18.