A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8] Check Box Variable Assignment

  1. #1
    Junior Member
    Join Date
    Aug 2008
    Posts
    28

    [F8] Check Box Variable Assignment

    Hello,

    I have got a component within my flash form. I have a button that sends information to PHP (this is working, no help needed for this bit).

    What I need help with is checking whether the check box is selected or not, so that if it is my button will go to one place, and if not then it will go to another (which I know will be done with an 'if' statement).

    Any help would be great.

    Cheers,

  2. #2
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    I don't use components, but basically

    PHP Code:
    var bCheckboxClicked false;

    if (
    bCheckboxClicked){
       
    //do this
    }else{
      
    //do this

    when the check box is clicked you would set the variable to true, the If checks to see if the variable is true, if it is. Do want you want, if it is not, do the other.


    IMS

  3. #3
    Junior Member
    Join Date
    Aug 2008
    Posts
    28
    I cannot get this working.

    Basically by tick/check box has the following names:

    label:- 'CheckBox'
    Instance Name:- 'CheckBoxInstance'

    My button does the following:

    on (release) {

    form.loadVariables("email.php", "POST");
    form2.loadVariables("email.php", "POST");
    gotoAndStop(3);

    }

    I need it so that on release, if the box is ticked it does the above, if not it will go back to (1).

    Cheers

    p.s. Sorry about not putting the code in the table like you, I do not know how too.

  4. #4
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    the button should look like this:

    PHP Code:
    on (release) {
    if (
    box1Cecked == true){
           
    form.loadVariables("email.php""POST");
           
    form2.loadVariables("email.php""POST");
           
    gotoAndStop(3);
          }else{
           
    gotoAndStop(1);
       }

    something along those lines

    IMS

  5. #5
    Junior Member
    Join Date
    Aug 2008
    Posts
    28
    Thanks,

    But what is it I name 'box1Cecked' and where do I declare this? On the checkbox?

    How does this change to true when the user selects the box?

    Cheers,

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