1 Reply Latest reply on Nov 9, 2006 12:26 AM by rohai

    how to check if the data from asp is ready?

    rohai
      Hi,

      my script sends the vars to asp, which creates new xml. In flash a new swf opens and loads the new xml. But here's the problem. The second swf doesn't receive the data. I assume that the xml in not ready when the swf loads. How can I check to see if the data is ready to load into flash? It's working if I only target an asp page with "fixed querystring" - I don't send it to asp, it's defined on the asp page - but when sending a query, it's not working.THX for your help
        • 1. Re: how to check if the data from asp is ready?
          rohai Level 1
          hmmm....here's the script that opens the second swf.

          program = function(){
          movie = this.swf;
          id = this.query;
          var recievedProgram = new LoadVars();
          var sendProgram = new LoadVars();
          sendProgram.scene = movie;
          sendProgram.programID = id;
          sendProgram.sendAndLoad("actions1.asp","POST");
          home_mc._visible = false;
          main_mc._visible = true;
          mcLoader.loadClip("program.swf", main_mc);
          trace(id);
          trace(movie);
          trace(sendProgram);
          };

          And here's the script in program.swf.

          var my_xml = new XML();
          my_xml.ignoreWhite = true;
          my_xml.onData = function() {
          trace("XML packet loaded.");
          this.onLoad(true);
          };

          my_xml.onLoad = function(success){
          if (success){
          var program = my_xml.firstChild;
          program_content.text = program.firstChild.nodeValue;
          trace(this);
          }
          }
          my_xml.load("actions1.asp"+(_url.indexOf("file")==0?"":"?timestamp="+escape(new Date().toString())));
          //my_xml.load("actions1.asp");


          If I use onData function, I get undefiend. Please help, it's now day 2