Skip navigation
Currently Being Moderated

How to use check box in flash 8?

May 24, 2012 9:52 AM

How to use check box in flash 8?

 
Replies
  • Currently Being Moderated
    May 24, 2012 10:31 AM   in reply to syednoorullah92

    Place it on the stage and assign it an instance name.  When you want to see if it is checked, you test its "selected" property.  So if you name the checkbox "cb", then you would use the following to see if it is selected....

     

    if(cb.selected){

        // do whatever

    }

     
    |
    Mark as:
  • Currently Being Moderated
    May 25, 2012 12:49 PM   in reply to syednoorullah92

    case matters, so use "selected", not "Selected"  Also, make sure you assigned the instance name "cb" to the checkbox

     
    |
    Mark as:
  • Currently Being Moderated
    May 26, 2012 10:12 AM   in reply to syednoorullah92

    If you want it to happen when someone clicks the checkbox, then you need to add a listener for that event.

     

    var cbListener:Object = new Object();

    cbListener.click = function (evt:Object) {

        if (cb.selected) {

              gotoAndStop(2);

        }

    }

    cb.addEventListener("click", cbListener);

     

    (Note: "cb" and "cbListener" are names that were made up for this example.  They could be anything you want to name them)

     
    |
    Mark as:
  • Currently Being Moderated
    May 26, 2012 11:16 AM   in reply to syednoorullah92

    Put a trace command in the function to make sure it is executing.

     

    cbListener.click = function (evt:Object) {

       trace(cb.selected);

        if (cb.selected) {

              gotoAndStop(2);

        }

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points