A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Feedback Page

  1. #1
    Junior Member
    Join Date
    Mar 2007
    Posts
    10

    [F8] Feedback Page

    Hi All,

    I am having trouble with the feedback's page of my web site. When I click the Submit Button, the form info is suppose to be sent to my email address. Below is the Action Script 2.0 coding I have written. Could someone please let me know if I wrote something incorrect?

    stop();

    //sets a default component to react to the enter key on the keyboard
    focusManager.defaultPushButton=bSend;

    //sends the Information out of Flash
    bSend.onRelease = function() {
    var targetLoadVars:LoadVars = new LoadVars();
    var myLoadVars:LoadVars = new LoadVars();
    myLoadVars.EasyNavYes = rbYes.selectedItem;
    myLoadVars.EasyNavNo = rbNo.selectedItem;
    myLoadVars.RateSite = nsRate.value;
    myLoadVars.Improvements = taImprove.text;
    myLoadVars.emailTo =tiEmailTo.text;
    myLoadVars.sendAndLoad ("http://www.flash-mx.com/ws/submit_feedback.cfm", targetLoadVars, "POST");
    targetLoadVars.onLoad = function() {
    trace(this.success);
    };
    gotoAndStop("Thank You");
    };

    I'll appreciate any help,
    Alan

  2. #2
    Member
    Join Date
    Apr 2004
    Posts
    78
    I've never used LoadVars for this sort of thing. Many people do, but I've never found it necessary. loadVariablesNum with POST will pick up every variable value on the page. Here's a very simple version of what I do:

    Code:
    //-------------------Mail Form-------------------------
    // Set the tab order for the text fields.
    name_txt.tabIndex = 1;
    email_txt.tabIndex = 2;
    city_txt.tabIndex = 3;
    message_txt.tabIndex = 4;
    
    // a function to clear the text fields
    clearFields = function () {
    	status = "";
    	name = "";
    	email = "";
    	city = "";
    	message = "";
    	maillistCkbx.selected = false;
    }
    
    clearFields();
    
    // Buttons
    clear_btn.onRelease = function() {
    	clearFields();
    }
    
    send_btn.onRelease = function() {
    	if (name == "" || email == "" || city == "" || message == "") {
    		form_message = "Please complete the entire form ...";
    	} else {
    		maillist = maillistCkbx.selected;
    		loadVariablesNum("contact.php", 0, "POST");
    		nextFrame();
    	}
    }
    Last edited by Len Rooney; 04-06-2007 at 10:07 PM.

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