4 Replies Latest reply on Aug 16, 2007 10:43 PM by MughalShahzad

    Submit

    MughalShahzad Level 1
      I am making a quiz in director. I want to disable submit button when new question comes in front of student and want to enable that button when student has select any option.
        • 1. Re: Submit
          Minds Eye Level 1
          Hi Shahzad,
          You haven't really given much info to go on here.
          I'm presuming you have a number of radio buttons and when the user has pressed a button it will only do something if one of the radio buttons has been selected.

          This piece of code goes on each radio button (1 radio cast member for each sprite) :
          on mouseUp me
          sendAllSprites(#turnOff)
          sprite(me.spriteNum).member.hilite = true
          end

          on turnOff me
          sprite(me.spriteNum).member.hilite = false
          end

          This mouse up handler goes on the "Submit" button. It presumes you 3 radio buttons are on channels 1, 2 and 3
          on mouseUp me
          repeat with i = 1 to 3
          if sprite(i).member.hilite then
          radioVal = i
          end if
          end repeat
          if radioVal = void then exit

          --put here your code to handle quiz answer
          put radioVal
          sendAllSprites(#turnOff)
          end

          Regards,
          Trevor
          • 2. Re: Submit
            James Newton, ACP Level 3
            In addition to Trevor's scripts, you could place an additional sprite in the channel above the Submit button. This sprite would contain artwork that shows a disabled button, and would have the following behavior:

            on TurnOff(me)
            vSprite = sprite(me.spriteNum)
            vMember = vSprite.member
            vLocH = vMember.regPoint.locH - vMember.width
            vSprite.locH = vLocH
            end

            As soon as the user clicks one of the radio buttons, the disabled sprite will disappear (move off-stage), to reveal the active Submit button.
            • 3. Re: Submit
              MughalShahzad Level 1
              thank you so much you solved my problem
              • 4. Re: Submit
                MughalShahzad Level 1
                thank you James Newton