6 Replies Latest reply on Dec 15, 2007 12:26 AM by ArmanIc

    Flash checkbox checked?

    ArmanIc
      Hi,

      Just a simple question.
      The Director v9 style checkbox has the property .hilite that is true if the box is checked. As far as I could see, this does not work on Flash checkboxes of Director v10.
      How can I detect that a Flash button is checked?


        • 1. Re: Flash checkbox checked?
          Level 7
          Open the docs that ship with Director (F1), activate the Contents tab,
          click/expand the Using Director section, do the same for the Using
          Flash, Flash Components, ... section and then the CheckBox component
          section and finally the Property summary for the CheckBox class
          • 2. Re: Flash checkbox checked?
            ArmanIc Level 1
            Hi Sean, thanks for your tip. In fact, I did not see that part of the doc yet.
            But, it does not help. I can still not detect if a checkbox is checked, because the .hilite property of it does not change.

            I attached the following basic behavior script to the checkbox sprite:

            on mouseUp
            if member("ckbCheckbox2").hilite = TRUE then
            put "Checkbox 2 CHECKED"
            else
            put "Checkbox 2 unchecked"
            end if
            end

            Clicking the checkbox I always get "unchecked", even if the initial state is "checked" (property .selected = true). It seem that the .hilite property doesn't change at all.
            A non-Flash checkbox and it's behavior work OK.

            Any suggestions?
            • 3. Re: Flash checkbox checked?
              Level 7
              I don't know where you're getting the 'hilite' property from as the docs
              - in the section I referred you to - detail a 'selected' property, which
              is what I think you need to get/set.
              • 4. Re: Flash checkbox checked?
                ArmanIc Level 1
                As far as I can see, the .hilite property gives the current selection state of a checkbox, whereas the .selected property sets the initial state of Flash checkboxes.
                • 5. Re: Flash checkbox checked?
                  Level 7
                  put sprite(1).selected
                  -- 0
                  (click the sprite on the stage - that is, check the box)
                  put sprite(1).selected
                  -- 1
                  • 6. Re: Flash checkbox checked?
                    ArmanIc Level 1
                    Yes! I see what I did wrong.
                    Thus, the difference between the two types of checkboxes is that the normal checkbox uses the 'hilite' property of the cast member. The Flash checkbox, however, uses the '.selected' property of the sprite.
                    Thanks for your help.