Comunidad de diseño web y desarrollo en internet online

Ayuda con .load()

Citar            
MensajeEscrito el 21 Feb 2009 03:52 am
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.

un ejemplo de un XML puede ser:

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

Por christiancarlos

0 de clabLevel



 

msie7
Citar            
MensajeEscrito el 21 Feb 2009 06:29 am
Hola, agrega al incio:

Código ActionScript :

System.security.allowDomain("http://xml.djuego.com");


Si eso no funciona, podrias postear la url de uno de los archivos xml que este visible en la red? para ver si hay un problema en la ruta.

Por LongeVie

Claber

1741 de clabLevel

1 tutorial

Genero:Masculino  

En un lugar, re moto.

firefox

 

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