2 Replies Latest reply on Jul 31, 2012 1:30 PM by joedart

    how to delineate data returned

    joedart

      How can I delineate the data returned to flash using URLLoader()?

       

       

      This Python script:

       

      #! /usr/bin/python

       

      import cgi
      form = cgi.FieldStorage()
      adobex = form.getvalue('inquire')

      print 'Content-type: text/plain\n\n<?xml version="1.0"

      encoding="utf-8"?>\n'

      print '<result>'
      print "adobex=%s" % adobex
      print '</result>'

       

      This script receives and responds to URLLoader() but I can't seem to extricate the variable I want using either of these:

       

      my_return_value.text=event.target.data;

       

      or

       

      my_return_value.text = event.target.data.adobex;

       

      The former gives me this amalgamation:

       

       

      %3C%3Fxml%20version=%221%2E0%22%20encoding%3D%22utf%2D8%22%3F%3E%0A%0A%3Cresult%3E%0Aadobe x%3Dsendthisstuff%0A%3C%2Fresult%3E%0A

      How can the variable adobex be isolated from the returning stuff?

      Thanks.

        • 1. Re: how to delineate data returned
          joedart Level 1

          follow up. I'ver been experimenting with various python print statements and this code is as close as I can get to receiving the data using URLLoader. However, it is not assigning the string to the variable name so asking for that variable gives me nothing. This python code:

           

          #! /usr/bin/python

           

          import cgi
          form = cgi.FieldStorage()
          adobex = form.getvalue('inquire')
          adobex=str(adobex)
          print 'Content-type: text/plain\n\n'
          print "adobex=%s" % adobex

           

          sends back this response      %OAadobex=sendthisstuff1%OA          

           

          The string "sendthisstuff1"  is what I originally sent to the python script and I am trying to get that string back from the script.

           

          when I ask for event.target.data, I get the above

           

          when I ask for event.target.data.adobex, I get nothing at all.

           

          Question why is the listener not finding the variable adobex in data?

           

          thanks 

          • 2. Re: how to delineate data returned
            joedart Level 1

            skip it. I've got it all operating now. I doubt it is the official method, but I just trimmed off the collateral characters by using string culling.

             

            By the way, in case anyone else hasn't done this... the Date.Time thing doesn't work for the cache problem anymore but a random number in its place does fine.

             

            This new streaming program now streams twenty times faster (between fairbanks and chicago) than the previous encoder program. Not bad.

             

            Thanks for your URLLoader() suggestion which made all the difference.