8 Replies Latest reply on Jun 1, 2006 7:04 PM by Newsgroup_User

    sendAndLoad() nightmares

    JakeTheSnake3.0
      Hey everyone, I'm having copious amounts of problems in regards to sendAndLoad(). I know the code in flash is perfect. I know the code in my ASP page is perfect. Why is it screwing up? For one thing...I don't think the ASP page is receiving the right variable...and another, when I do response.write back to flash, it sends the entire freakin page. What the hell is goin on? See code below.

      Flash:

      // Send and Load
      var sendID:LoadVars = new LoadVars();
      var receiveID:LoadVars = new LoadVars();
      sendID.linkID = theID;
      sendID.sendAndLoad(" http://www.jake3p0.com/test/index.asp", receiveID, "POST");
      //
      receiveID.onLoad = function(success:Boolean) {
      if (success) {
      trace(this);
      _global.asdf = this;
      } else {
      trace("Not Done");
      }
      };


      ASP Code:

      <%
      -- Top of page
      Response.Buffer = True
      dim pageID
      pageID = Trim(Request.Form("linkID"))


      -- Somewhere near the end
      dim flashStr
      flashStr = "Page ID: "+pageID
      Response.Write(flashStr)
      %>

      Essentially for what I want to do, I don't really need to send information back to flash. But the fact remains that the ASP page isn't understanding the variable being sent to it by flash. And even if by chance I do want to receive variables back, what's this garbage all about?

      %0A%3C%21DOCTYPE%20html%20PUBLIC%20%22%2D%2F%2FW3C%2F%2FDTD%20XHTML%201%2E0%20Transitional %2F%2FEN%22%20%22http%3A%2F%2Fwww%2Ew3%2Eorg%2FTR%2Fxhtml1%2FDTD%2Fxhtml1%2Dtransitional%2 Edtd%22%3E%0D%0A%3Chtml%20xmlns=%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F1999%2Fxhtml%22%3E%0A%0A% 3Chead%3E%0A%3Cmeta%20http%2Dequiv%3D%22Content%2DType%22%20content%3D%22text%2Fhtml%3B%20 charset%3Diso%2D8859%2D1%22%20%2F%3E%0A%3Cmeta%20name%3D%22Author%22%20content%3D%22Jake%2 0Mitchell%22%20%2F%3E%0A%3Clink%20rel%3D%22shortcut%20icon%22%20href%3D%22http%3A%2F%2Fwww %2Ejake3p0%2Ecom%2Ffavicon%2Eico%22%20%2F%3E%0D%0A%3Clink%20rel%3D%22stylesheet%22%20type% 3D%22text%2Fcss%22%20href%3D%22http%3A%2F%2Fwww%2Ejake3p0%2Ecom%2Fcss%2F3p0%2Ecss%22%20%2F %3E%0A%3Ctitle%3Ewww%2EJake3p0%2Ecom%20Test%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0D% 0A%3Cdiv%20id%20%3D%22navigation%22%3E%0A%3Cobject%20data%3D%22data%2Fnav%2Eswf%22%20id%3D %22nav%22%20type%3D%22application%2Fx%2Dshockwave%2Dflash%22%20width%3D%22310%22%20height% 3D%2225%22%3E%0D%0A%3Cparam%20name%3D%22movie%22%20value%3D%22data%2Fnav%2Eswf%22%20%2F%3E %0D%3Cparam%20name%3D%22allowScriptAccess%22%20value%3D%22sameDomain%22%20%2F%3E%0D%0A%3Cp aram%20name%3D%22play%22%20value%3D%22true%22%20%2F%3E%0D%0A%3Cparam%20name%3D%22loop%22%2 0value%3D%22false%22%20%2F%3E%0D%0A%3Cparam%20name%3D%22menu%22%20value%3D%22false%22%20%2 F%3E%0D%0A%3Cparam%20name%3D%22quality%22%20value%3D%22best%22%20%2F%3E%0D%0A%3Cparam%20na me%3D%22scale%22%20value%3D%22noscale%22%20%2F%3E%0D%0A%3Cparam%20name%3D%22bgcolor%22%20v alue%3D%22%23000000%22%20%2F%3E%0D%0A%3Cparam%20name%3D%22devicefont%22%20value%3D%22false %22%20%2F%3E%0D%0A%3C%2Fobject%3E%0A%3C%2Fdiv%3E%0D%0A%3Cdiv%20id%20%3D%22content%22%3E%0D %0APage%20ID%3A%20welcome%0D%0A%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E&onLoad=%5Btype %20Function%5D
        • 1. Re: sendAndLoad() nightmares
          TimSymons Level 1
          Is your Flash file initiated in the index.asp page? If so, then that is your problem. You will need to place that ASP code that will process the information sent from Flash in a different ASP file than the one that defines the <OBJECT> tag for your Flash file.

          Tim
          • 2. Re: sendAndLoad() nightmares
            JakeTheSnake3.0 Level 1
            How would I pass the variable from that page back into the index page?
            • 3. Re: sendAndLoad() nightmares
              TimSymons Level 1
              Each time the index.asp page is called, the code inside of it will execute. That means that your Flash file will be reloaded which is causing your problem.

              What are you trying to do with the value? You may have to rethink your file structure or maybe use HTML frames to accomplish what you need.

              Tim
              • 4. Re: sendAndLoad() nightmares
                JakeTheSnake3.0 Level 1
                Not with sendAndLoad(). That happens when you use just send(). The structure of my pages is perfectly fine. I've tested it with static variables.

                What I intend to do should have been very simple.

                The swf that passes the variable is meant for navigation.

                Each button has a value associated with it, that when passed to the index page via POST, then index page then decides which asp file to include. However for now, I'm simply trying to get it to recognize the variable being sent to it.
                • 5. Re: sendAndLoad() nightmares
                  TimSymons Level 1
                  Not sure what you mean with "static variables"? Also, I will look more closely at the sendAndLoad function. It was my understanding that the entire ASP was re-executed so that would include the creation of the Flash piece again.

                  Tim
                  • 6. Re: sendAndLoad() nightmares
                    JakeTheSnake3.0 Level 1
                    Nope...if that were the case then there would be no reason to put an onLoad function for the loadVars object. And by static variables I mean I simply gave the variable a static value like "welcome" and not a value like Trim(Response.Form("ID"))
                    • 7. Re: sendAndLoad() nightmares
                      TimSymons Level 1
                      Ya, sorry about that. I had a DOH! moment on my drive home. The index.asp page is completely processed again, which is why you get the HTML code returned to your Flash file, but it won't actaully reload the original Flash file.

                      So, now that I have my senses about me again. Explain to me what you are trying to accomplish and how you are using the value passed to the index.asp page. You mentioned that you will be using it to decided which other ASP pages to load? But you may actually be receiving the correct value from Flash but can't tell since the index.asp page is process the HTML code and that is what is getting returned to Flash.

                      Can you setup a HTML form textfield to display the value passed from Flash? That way you won't have to rely on the information returned to Flash.

                      Tim
                      • 8. Re: sendAndLoad() nightmares
                        Level 7
                        >>when I do response.write back to flash, it sends the entire freakin page.

                        You need to have the ASP page running in a web server and connect to it
                        with http://. If you are working inside the Flash authoring environment you
                        may need to hardwire the http://yourtestingdomainname/theaspfile.asp for the
                        sendAndLoad.

                        --
                        Lon Hosford
                        www.lonhosford.com
                        May many happy bits flow your way!
                        "JakeTheSnake3.0" <webforumsuser@macromedia.com> wrote in message
                        news:e5negp$5bu$1@forums.macromedia.com...
                        Hey everyone, I'm having copious amounts of problems in regards to
                        sendAndLoad(). I know the code in flash is perfect. I know the code in my
                        ASP
                        page is perfect. Why is it screwing up? For one thing...I don't think the
                        ASP
                        page is receiving the right variable...and another, when I do response.write
                        back to flash, it sends the entire freakin page. What the hell is goin on?
                        See code below.

                        Flash:

                        // Send and Load
                        var sendID:LoadVars = new LoadVars();
                        var receiveID:LoadVars = new LoadVars();
                        sendID.linkID = theID;
                        sendID.sendAndLoad("<a target=_blank class=ftalternatingbarlinklarge
                        href=" http://www.jake3p0.com/test/index.asp",">http://www.jake3p0.com/test/index
                        .asp",</a> receiveID, "POST");
                        //
                        receiveID.onLoad = function(success:Boolean) {
                        if (success) {
                        trace(this);
                        _global.asdf = this;
                        } else {
                        trace("Not Done");
                        }
                        };


                        ASP Code:

                        <%
                        -- Top of page
                        Response.Buffer = True
                        dim pageID
                        pageID = Trim(Request.Form("linkID"))


                        -- Somewhere near the end
                        dim flashStr
                        flashStr = "Page ID: "+pageID
                        Response.Write(flashStr)
                        %>

                        Essentially for what I want to do, I don't really need to send information
                        back to flash. But the fact remains that the ASP page isn't understanding
                        the
                        variable being sent to it by flash. And even if by chance I do want to
                        receive
                        variables back, what's this garbage all about?


                        %0A%3C%21DOCTYPE%20html%20PUBLIC%20%22%2D%2F%2FW3C%2F%2FDTD%20XHTML%201%2E0%20Tr
                        ansitional%2F%2FEN%22%20%22http%3A%2F%2Fwww%2Ew3%2Eorg%2FTR%2Fxhtml1%2FDTD%2Fxht
                        ml1%2Dtransitional%2Edtd%22%3E%0D%0A%3Chtml%20xmlns=%22http%3A%2F%2Fwww%2Ew3%2Eo
                        rg%2F1999%2Fxhtml%22%3E%0A%0A%3Chead%3E%0A%3Cmeta%20http%2Dequiv%3D%22Content%2D
                        Type%22%20content%3D%22text%2Fhtml%3B%20charset%3Diso%2D8859%2D1%22%20%2F%3E%0A%
                        3Cmeta%20name%3D%22Author%22%20content%3D%22Jake%20Mitchell%22%20%2F%3E%0A%3Clin
                        k%20rel%3D%22shortcut%20icon%22%20href%3D%22http%3A%2F%2Fwww%2Ejake3p0%2Ecom%2Ff
                        avicon%2Eico%22%20%2F%3E%0D%0A%3Clink%20rel%3D%22stylesheet%22%20type%3D%22text%
                        2Fcss%22%20href%3D%22http%3A%2F%2Fwww%2Ejake3p0%2Ecom%2Fcss%2F3p0%2Ecss%22%20%2F
                        %3E%0A%3Ctitle%3Ewww%2EJake3p0%2Ecom%20Test%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cb
                        ody%3E%0D%0A%3Cdiv%20id%20%3D%22navigation%22%3E%0A%3Cobject%20data%3D%22data%2F
                        nav%2Eswf%22%20id%3D%22nav%22%20type%3D%22application%2Fx%2Dshockwave%2Dflash%22
                        %20width%3D%22310%22%20height%3D%2225%22%3E%0D%0A%3Cparam%20name%3D%22movie%22%2
                        0value%3D%22data%2Fnav%2Eswf%22%20%2F%3E%0D%3Cparam%20name%3D%22allowScriptAcces
                        s%22%20value%3D%22sameDomain%22%20%2F%3E%0D%0A%3Cparam%20name%3D%22play%22%20val
                        ue%3D%22true%22%20%2F%3E%0D%0A%3Cparam%20name%3D%22loop%22%20value%3D%22false%22
                        %20%2F%3E%0D%0A%3Cparam%20name%3D%22menu%22%20value%3D%22false%22%20%2F%3E%0D%0A
                        %3Cparam%20name%3D%22quality%22%20value%3D%22best%22%20%2F%3E%0D%0A%3Cparam%20na
                        me%3D%22scale%22%20value%3D%22noscale%22%20%2F%3E%0D%0A%3Cparam%20name%3D%22bgco
                        lor%22%20value%3D%22%23000000%22%20%2F%3E%0D%0A%3Cparam%20name%3D%22devicefont%2
                        2%20value%3D%22false%22%20%2F%3E%0D%0A%3C%2Fobject%3E%0A%3C%2Fdiv%3E%0D%0A%3Cdiv
                        %20id%20%3D%22content%22%3E%0D%0APage%20ID%3A%20welcome%0D%0A%3C%2Fdiv%3E%0A%3C%
                        2Fbody%3E%0A%3C%2Fhtml%3E&onLoad=%5Btype%20Function%5D