4 Replies Latest reply on Mar 15, 2010 9:06 AM by martinjconnolly

    Error 2032 - driving me mad

    martinjconnolly Level 1

      Hi all, I've had an application running successfully using a PHP backend on my remote web server for years. The web server has crashed and so I have had to install a PHP stack on my development laptop using Zend Server CE V4.03. The URL that I call in my HTTPService (ie on my laptop) produces exactly the right results. But my Flex app hits error 2032.

       

      I have added a crossdomain.xml into the root of the web server with the following content:

       

      ?xml version="1.0"?>
      <!-- http://localhost/crossdomain.xml -->
      <cross-domain-policy>
          <allow-access-from domain="*" secure="false"/>
      </cross-domain-policy>

       

      And my app uses flash.system.Security.loadPolicyFile("http://localhost/crossdomain.xml") in the creationComplete code.

       

      My app hits the 2032 whether called from Flex (ie running as file://C:......) or deployed to the webserver. WHY? Could it be to do with the level of Flash? I'm using 10.0.32.18. I've also tried changing the localhost to 127.0.0.1 in the code and in the URL I type to launch the app, with no success. What do I have to do so that Flex can just load data from PHP running on the same machine?

       

      Thanks!!

        • 1. Re: Error 2032 - driving me mad
          Gregory Lafrance Level 6

          You might need to set the --use-network=false compiler option.


          Project - Properties - Flex Compiler


          add --use-network=false to the "Additional compiler arguments:" section.

          When deploying to a live server you probably have to recompile with --use-network=true.

          If this post answers your question or helps, please mark it as such.


          Greg Lafrance - Flex 2 and 3 ACE certified

          www.ChikaraDev.com

          Flex / AIR Development, Training, and Support Services

          • 2. Re: Error 2032 - driving me mad
            martinjconnolly Level 1

            sorry, I forgot to add that the data is still in a remote database even though the PHP server is local. Your suggestion clears the 2032 error but I just get a null lastResult back from my HTTPService instead.

            • 3. Re: Error 2032 - driving me mad
              Gregory Lafrance Level 6

              I prefer to not use lastResult, but instead to use a ResultEvent handler function.

               

              That way you can check to see if data is being returned.

               

              Did you verify that within the PHP script is getting the request from Flex and is working correctly?

               

              If this post answers your question or helps, please mark it as such.


              Greg Lafrance - Flex 2 and 3 ACE certified

              www.ChikaraDev.com

              Flex / AIR Development, Training, and Support Services

              • 4. Re: Error 2032 - driving me mad
                martinjconnolly Level 1

                Greg, it's hitting the 2032 error without the PHP script being executed. I look for the data with a function tied to  a "result=...." in the HTTPService markup. How would that differ from using a ResultEvent?

                Cheers

                Martin