7 Replies Latest reply on May 18, 2007 7:13 PM by joeschmoesdf

    POST problem

    joeschmoesdf
      I am trying to make a search box in flash however no matter what I do I cant manage to make it work...

      here is the script in highlighted form http://pastebin.ca/494701

      and the PHP if anyone wants to or needs to see it http://pastebin.ca/494567

        • 1. Re: POST problem
          Level 7
          Using just one LoadVars is not the ideal way... have a look at the
          sendAndLoad example in Help and note how a sender and a receiver LpadVars is
          used. I've never had an issue going that route.

          --
          Dave -
          Head Developer
          http://www.blurredistinction.com
          Adobe Community Expert
          http://www.adobe.com/communities/experts/


          • 2. POST problem
            Greg Dove Level 4
            I think I pasted a new version on that pastebin site... that's kinda cool, never seen that before.

            You're using loadVars to send the search and return to the same loadVars. But you're returning an xml string. So you need to assign it to a property of the receiving loadvars and then parse it as xml. Or you could format and send the search query as xml and receive it back as xml as an alternative
            • 3. Re: POST problem
              joeschmoesdf Level 1
              Honestly I am WAY over my head with this. I tried to look at the Help files however I can't make heads nor tails of this. I apologize for this but could anyone please explain in depth how it works or post a way it works, I just learned AS, PHP, and ASP in the last 2-3 weeks for this project as such im fried and out of ideas ;P

              thank you to the people that tried to help before i just don't have the slightest clue what you are talking about...
              • 4. Re: POST problem
                Greg Dove Level 4
                for loadVars to work, PHP needs to return a string that says:

                name=value&name2=value&name3=value

                etc (it can just be one name=value without the & and others)

                In your case, you were returning an XML string to a LoadVars, so php needs to print or echo
                xmlstring=<something><more>moreValue</more></something>

                that way your receiving LoadVars will have a property called xmlstring with the value of "<something><more>moreValue</more></something>"

                LoadVars is basically for sending and receiving name/value pairs.

                XML is for sending and receiving xml 'strings', and having local object representation of the xml data as a flash object once its parsed after loading.

                You're sending name/values and returning an xml string. if you do that using loadVars you need to do it as a name/value and then parse it into an xml object afterwards.

                the other thing that Dave mentioned above is that its probably a good idea to have a sending LoadVars and a receiving one. I would be inclined to do the same.

                This is the type of example that's in the documentation...check it out:
                http://livedocs.adobe.com/flash/8/main/00002336.html#wp292432

                I think 2-3 weeks to learn all that is kinda a big ask of yourself (or whoever's asking it of you).
                • 5. POST problem
                  joeschmoesdf Level 1
                  Thank you for that how would I go about having 2 loadvars? I kinda get what I did above because that is the way that i created the login however now what I am trying to do is create a search function that will populate a listbox with data. Then the listbox populates txtboxes with data based on what listbox item is clicked.

                  the data that I have is in the original format of

                  <dataSet>
                  <data>
                  <name></name>
                  <Solution></Solution>
                  <Submited></Submited>
                  <Reward></Reward>
                  </data>
                  </dataSet>

                  I dont have a choice but to work with that if I need to I could convert it to another syntax im going to try and make an ASP script that will return the xml in that format however I dont know the way to create a search function in ASP just PHP do you have any ideas on that?

                  As for the time restraints quite frankly i don't think they care, I am working with a group on this and i think one of them can create a motion tween (there the IT guys) so I kinda got the short straw if you catch my drift...


                  Edit: Ok i did get an ASP script that was able to return in that datastyle how will I go about posting variables to it or will I have to link the ASP to another PHP script? Also I dont know how to program te search with it.


                  Thank You Again
                  • 6. Re: POST problem
                    Greg Dove Level 4
                    Sorry I don't know much about server side coding (yet), so can't answer those questions. Others may know, but this is primarily an actionscript forum.

                    You could also have worked with the xml data returned as it was, it would just need to be parsed into a new XML object.

                    On a side note, I have no idea if its also possible to have the receiving object for a LoadVars sendAndLoad to be an XML object. Others may know and if so, that might be worth checking out.

                    Have you tried googling for a tutorial on this type of thing? I think that's what you probably need to do in order to understand quickly the what and how.
                    http://www.google.fr/search?hl=en&safe=off&q=flash+tutorial+loadVars.sendAndLoad


                    • 7. Re: POST problem
                      joeschmoesdf Level 1
                      I have looked for a tutorial and eather there speaking Greek or its not helpful. I did however i did see the XML.sendandload and tried this http://pastebin.ca/496112 yet still nothing....