4 Replies Latest reply on Aug 11, 2009 9:41 PM by Gregory Lafrance

    amfphp

    Seglespaan Level 1

      Hi,

       


      I have a flex app that uses amfphp to call php functions, this works when I run the swf locally, or in a browser locally and is accessing the remote db on the server,

       

      however when I upload the swf to the server the swf doesn't seem to be returning any results from the db

       

      I've also checked the php functions using the service browser and it works fine,

       

      anyone ever experianced this or had any similar issues?

       

      Cheers

       

      Tim

        • 1. Re: amfphp
          Gregory Lafrance Level 6

          Is compiler argument   -use-network   set to true?

           

          Project - Properties - Flex Compiler - Additional compiler arguments,   add   -use-network=true

           

          If this post answered your question or helped, please mark it as such.

          • 2. Re: amfphp
            Seglespaan Level 1

            didn't seem to make any difference

            • 3. Re: amfphp
              Seglespaan Level 1

              figured I should add my code

               

              public function getDistinct():Object
                          {
                             
                              var gw:NetConnection = new NetConnection();
                              gw.connect("http://myserver/amfphp/gateway.php");
                                //gw.connect("http://localhost/amfphp/gateway.php");
                              var res:Responder = new Responder(onResult, onFault);
                            
                              function onResult(responds:Object):void
                              {
                            
                                categoryResult = new ArrayCollection(responds.serverInfo.initialData);  
                             
                              }
                            
                              function onFault(responds:Object):void
                              {
                                  for(var i in responds)
                                  {
                                     
                                      trace(responds[i]);
                                  }
                              }
                            
                             gw.call("SPMethods.getDistinct", res);
                     
                              return res;
                          }

               

               

               

               

              <mx:List id="categoryList"
                                  width="101" x="10" y="10"
                                  dataProvider = "{categoryResult}" labelField="1"
                                  change="changeIcons(categoryList.selectedItem)"  height="225">
                              </mx:List>

               

               

               

              which like I say does work when I run it locally

              • 4. Re: amfphp
                Gregory Lafrance Level 6

                Is your SWF also being served from http://myserver/amfphp ?

                 

                You may be facing a situation where a crossdomain.xml file is necessary.

                SWF files can only access data in the same domain where they were served from, and http://myserver.myCompany.com will be a different domain from http://www.myCompany.com, as sub-domains are treated as different domains.

                 

                http://livedocs.adobe.com/flex/3/html/help.html?content=security2_04.html

                 

                http://stackoverflow.com/questions/679952/flex-issue-with-crossdomain-xml-and-filereferenc e-upload

                 

                If this post answered your question or helped, please mark it as such.