dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Flash MX: mixing MXL and LoadVars objects in one sendAndLoad()?

  1. #1
    webdesigner Marek Binkowski's Avatar
    Join Date
    May 2002
    Location
    Poland
    Posts
    142

    Flash MX: mixing MXL and LoadVars objects in one sendAndLoad()?

    Hi,

    my short question is: is it possible to communicate with PHP on the serwer this way?:

    sendObject=new LoadVars();
    sendObject.someVariable = someValue;

    loadObject=new XML();

    sendObject.sendAndLoad(phpscriptURL.php,loadObject ,"GET")


    Another words, is it possible to send a Query in normal querystring (script.php?name=value), and get the answer as XML? Or when you want get XML, you must also send XML?

    Yet another words: is it possible to mix the functionality of XML and LoadVars objects in one sendAndLoad() method?

    Please answer, if you know something about it :-)
    marek binkowski
    webdesign ::: www.ampo.com.pl


  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhm...

    You can send anything you want through a URL and get anything back.

    When I do it I stick to XML in Flash and GET appends on the Server side script.
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

  3. #3
    webdesigner Marek Binkowski's Avatar
    Join Date
    May 2002
    Location
    Poland
    Posts
    142
    So it is no problem that in the method (sendAndLoad) of LoadVars I will put the name of and XML object to receive the answer?
    marek binkowski
    webdesign ::: www.ampo.com.pl


  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhm...

    I've never done that. I use the sendAndLoad method of the XML Object, since I'm going to be loading XML.

    You can still GET append things to the URL you use in the sendAndLoad...
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

  5. #5
    webdesigner Marek Binkowski's Avatar
    Join Date
    May 2002
    Location
    Poland
    Posts
    142

    Re: Uhm...

    Originally posted by VAYKENT


    You can still GET append things to the URL you use in the sendAndLoad...
    I'm afraid I don't understand that... could you explain? When I use XML.sendAndLoad(), it sends XML contained in XML object. When I choose the GET method, it just puts the XML as a string in querystring (after ? sing in URL). That's what I know. Do you want to say, that I can append normal name-value pairs to the URL querystring, using XML.sendAndLoad()?
    marek binkowski
    webdesign ::: www.ampo.com.pl


  6. #6
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhm...

    holderXML = new XML();
    myXML = new XML();
    myXML.sendAndLoad("theURL.php?var=value&var2=value 2", holderXML);

    The XML Object is passed using POST, but you've also appended other variables and values using GET. Obviously your script could deal with both of these.
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

  7. #7
    webdesigner Marek Binkowski's Avatar
    Join Date
    May 2002
    Location
    Poland
    Posts
    142
    Sounds interesting, but somewhat strange in practical use, i think

    But i checked for myself and the answer to my question is:

    YES!

    You can mix XML and LoadVars in one and the same sendAndLoad() method!
    You can send variables in a querystring, using object LoadVars with it't sendAndLoad(POST), and receive the answer as XML code, and pass it directly to XML object.

    Like this:

    LoadVarsObject=new LoadVars();
    LoadVarsObject.someVariable = someValue;

    XMLObject=new XML();

    LoadVarsObject.sendAndLoad(PHPscriptURL,XMLObject, "GET")


    And it works! :-)))


    Thank you VAYKENT for your help :-)
    marek binkowski
    webdesign ::: www.ampo.com.pl


  8. #8
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhm...

    Help?? I barely understood the question.. seems like you helped yourself more than I helped you... good job!
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center