A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: using the checkbox component

Hybrid View

  1. #1
    Senior Member
    Join Date
    Mar 2005
    Location
    MI
    Posts
    279

    using the checkbox component

    i need help i am making a flash form that sends variables to a php script and the php script mails it to me. What i need help with is how to get the checkbox component i am using to when clicked sets a variable so i can send it to my php script. For something that is supposed to be so easy components are annoyingly hard to use.

    Thanks guys the is the best flash help site i have ever used.
    Our greatest fear is not that we are inadequate,
    but that we are powerful beyond measure.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    on stage -two checkboxes - instance names - cb1 and cb2
    a button - instance name - btn_sendMail
    Code:
    cb1.label = "Bananas";
    
    o_cb1 = new Object();
    o_cb1.click = function(obj){
    sel_1 = obj.target.selected;
    lab_1 = obj.target.label;
    trace(lab_1+"/"+sel_1);
    };
    cb1.addEventListener("click", o_cb1);
    
    /////////////////////////////////////
    
    cb2.label = "Oranges";
    
    o_cb2 = new Object();
    o_cb2.click = function(obj){
    sel_2 = obj.target.selected;
    lab_2 = obj.target.label;
    trace(lab_2+"/"+sel_2);
    };
    cb2.addEventListener("click", o_cb2);
    
    /////////////////////////////////////
    
    btn_sendMail.onRelease = function(){
    lv = new LoadVars();
    if(sel_1) lv.selection1 = lab_1;
    if(sel_2) lv.selection2 = lab_2;
    trace(lv);
    lv.onLoad = function(){ trace(unescape(this)); };
    lv.sendAndLoad("path to php",lv,"POST");
    };
    
    /*--add to your php --
    <?php
    $selection1 = $_POST['selection1'];
    $selection2 = $_POST['selection2'];
    ......
    ......
    The visitor would like a quote on the following: 
    ------------------------------------------------------ 
    $selection1
    $selection2
    ......
    ?>
    */

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