A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Checkbox Troubles

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    22

    Unhappy Checkbox Troubles

    Currently, when I click a checkbox in form 2, if i navigate to form 3 using a button then navigate back to form 2 using a button, the checkbox is no longer checked. I tried using a variable to store whether the checkbox is checked or not but I'm having troubles. Please help.

  2. #2
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    In the first frame, i declare a variable, strOrganDonorCheck as "y";
    My code in the second frame (where the checkbox is):
    PHP Code:
    if (chkOD.selected == true){
        
    _root.strOrganDonorCheck "y";
    }
    if (
    _root.strOrganDonorCheck == "y"){
        
    chkOD.selected true;


  3. #3
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    is there a way to toggle boolean values?

  4. #4
    Senior Member
    Join Date
    Oct 2008
    Posts
    227
    Flash deselects the checkboxes for some reason, but using this script will work
    PHP Code:
    var listenerObject:Object = new Object();
    listenerObject.click = function(eventObject:Object) {
    if(
    chkOD_status== false){
    chkOD_status true;
    } else if(
    chkOD_status == true){
    chkOD_status false;
    } else {
    chkOD_status true;
    }
    chkOD.addEventListener("click"listenerObject);

    if(
    chkOD_status == true){
    chkOD.selected true;


  5. #5
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    I got a statement block must be terminated by '}' on line 3 and syntax error on line 17.

  6. #6
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    Heh. you forgot the last } on the last line

  7. #7
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    I tried it and the checkbox still becomes unselected if moving to a different frame

  8. #8
    Senior Member
    Join Date
    Oct 2008
    Posts
    227
    Hmm.. could you send the source?

  9. #9
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    I'm sorry I can't because it's not 'my' project, it's my company's project.

  10. #10
    Senior Member
    Join Date
    Oct 2008
    Posts
    227
    Oh, okay... Well, I have no idea why it doesn't work.. Could have something to do with the instance names. You could read up on the script, if you do not understand it, and try to mess a bit with it

  11. #11
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    Basically what I need is a way that if i select the checkbox, to change a value in a variable.

Tags for this Thread

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