4 Replies Latest reply on Nov 27, 2006 12:27 PM by Newsgroup_User

    Using numberd buttons to enter text into a field

    Leegee3
      Hi all, was wondering if I had 10 seperate sprites acting as buttons on a page, which will be numbered 0 -9, is it possible to use them to enter text into a field. e.g.

      If the user presses the sprite with a number 1 on it, would it be possible to have a 1 displayed in an edit field. I need to pretend as though im using a remote.

      thanks
        • 1. Re: Using numberd buttons to enter text into a field
          James Newton, ACP Level 3
          Look at the getPropertyDescriptionList() handler, and find out how to create a behavior with a given number as a parameter property.

          Look at the .text property of field and text members, to see how to set the text displayed in a field or text sprite.

          Look at the mouseUp() handler, to see how to execute an instruction when the user clicks on a button.

          • 2. Re: Using numberd buttons to enter text into a field
            Level 7
            You can create a behavior that will allow you to set a variable for each
            button. When you assign the behavior to your button sprite, it'll
            prompt you to enter the ButtonNumber property. Haven't tested this yet,
            but something like this should work:

            ---------------------------------------------------------------------------------
            global gNumberEntered

            property ButtonNumber

            on getPropertyDescriptionList
            description = [:]
            addprop description, #ButtonNumber, [#comment:"Enter number to assign
            to this button", #format:#integer, #range:[1,10], #default: 1]
            return description
            end getPropertyDescriptionList


            on mouseup
            sprite(the currentSpriteNum).member = member("buttonOver")
            gNumberEntered = ButtonNumber
            cursor -1
            end

            on mouseEnter me
            sprite(the currentSpriteNum).member = member("buttonOver")
            cursor 280
            end

            on mouseDown me
            sprite(the currentSpriteNum).member = member("buttonDown")
            end

            on mouseLeave me
            sprite(the currentSpriteNum).member = member("buttonUp")
            cursor -1
            end
            • 3. Re: Using numberd buttons to enter text into a field
              Level 7
              Correction...
              #range:[1,10] should be #range:[1..10]
              • 4. Re: Using numberd buttons to enter text into a field
                Level 7
                Word One - Denver wrote:
                > Correction...
                > #range:[1,10] should be #range:[1..10]

                Actually, wrong again. This time I checked the manual. You want:
                #range:[#min: 1, #max: 10]

                Sorry 'bout that.