A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Need an example of sendAndLoad.

  1. #1
    Senior Member
    Join Date
    Aug 2004
    Location
    London
    Posts
    410

    Need an example of sendAndLoad.

    I need an example of how to use sendAndLoad.

    I've looked up the help in the Flash files, but am not getting anywhere.

    I have on stage a movie called mainOrderReviewMovie that contains simple bits used to try and send data and receive data back.

    I have the following code (adapted from the Flash help files):
    code:

    mainOrderReviewMovie.onRelease = function()
    {
    submitListener();
    }

    function submitListener()
    {
    var send_lv:LoadVars = new LoadVars();
    var result_lv:LoadVars = new LoadVars();

    send_lv.email = mainOrderReviewMovie.email.text;
    send_lv.sendAndLoad("http://www.myDomain.com/email/cdontsExample.asp", result_lv, "POST");

    result_lv.onLoad = function(success:Boolean)
    {
    if (success)
    {
    mainOrderReviewMovie.resultsText.text = result_lv.welcomeMessage;
    // How do I send back variables!!?
    }
    else
    {
    mainOrderReviewMovie.resultsText.text = "Error connecting to server.";
    }
    };
    };



    All I seem to be getting is "Error connecting..."

    My asp code is as follows:
    code:

    <% @language="VBSCRIPT" %>

    <%
    Set objMail = Server.CreateObject("CDONTS.Newmail")
    objMail.To = request.form ("email")
    objMail.Subject = "Testing the system"
    objMail.From = "me@mydomain.com"
    objMail.Body = "nothing here"
    objMail.Send
    Set objMail = Nothing
    %>



    I can't figure out where I'm going wrong.

    I've attached my Fla... if that's any help.

    ANY help would be greatly appreciated.

    Thanks.


    OM

    (This post is an extentsion of my last one - apologies if this is repeat posting.)
    Attached Files Attached Files

  2. #2
    Cheap Bear Imitation eRkLaErBaEr's Avatar
    Join Date
    Mar 2003
    Location
    Forests
    Posts
    308
    code:

    sendVars = new LoadVars();
    //creates the variables to send
    sendVars.namevar = _parent.namef;
    sendVars.emailvar = _parent.emailf;
    sendVars.commentvar = _parent.commentf;
    receiveVars = new LoadVars();
    receiveVars.onLoad = function() {
    //get back any vars printed by the mailscript
    trace(this.resultvar);
    };
    sendVars.sendAndLoad("kontakt.php", receiveVars, "POST");



    this is what i am using when putting up flash mail forms.
    namef, emailf, commentf are the input text fields in the flash movie. they will be send to the php script as the variables namevar, emailvar and commentvar. my php script throws out another variable (resultvar) that will be send back to the flash movie; its content depends on the success of the mailto in the php script.

    don't know much about asp but i hope this is a starting point.
    Pink signature?


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