A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: LoadVars

  1. #1
    Junior Member
    Join Date
    Feb 2002
    Posts
    22
    I tried loadvars..
    this code doesn't work..

    I tried
    v.send("Email.aspx?from="+from+"&email="+email+"&s ubject="+subject+"&message="+ message);

    before I had v.from = from; but this didn't work so I tried the above code.. didn't work..

    Essentially, I would like to have a flash site and when you click then it sends to the server but without refreshing, opening new browser, etc...

    Thank you..

  2. #2
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    Code:
    v = new LoadVars();
    v.from = _root.fromText.text;
    v.email = _root.emailtext.text;
    v.subject = _root.subjectText.text;
    v.message = _root.messageText.text;
    v.onLoad = function(success) {  // to handle data returned (no new page)
        if (success) {
            trace("data sent successfully";
        } else {
            trace("unsuccessful");
        }
    }
    v.sendAndLoad("Email.aspx?from="+from+"&email="+email+"&subject="+subject+"&message="+message", v, "POST");
    where _root."whatever"Text are your input textfields.



  3. #3
    Junior Member
    Join Date
    Feb 2002
    Posts
    22
    Thank you~
    seems to work great.

    couple of more questions...
    when does success return false?
    and is there any way to have no new page without doing sendAndLoad ? (this question is just out of curiosity)

  4. #4
    President, save the
    New Zealand dollar foundation

    Join Date
    Jun 2000
    Posts
    1,743
    success should return false, if there is an error on the server side, like an application error, or you send a value that asp isn't expecting....

    no page? not sure without testing it,
    try using just send() and see what happens...

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