Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/02/2009, 22:06
christiancarlos
 
Fecha de Ingreso: febrero-2009
Mensajes: 15
Antigüedad: 15 años, 2 meses
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