2 Replies Latest reply on Apr 3, 2007 1:42 PM by light_shadow

    Problem about password input field

    light_shadow
      Anyone know of bullet font that can be used for a password input field? I know there is a "Password Entry" that can be used to display only bullet characters as the user types the password. You can set the password in it.

      But I also need to have the "change password" page for users to change the password. So, the password input field should have the same password when the users change the password in the "change password" page.

      The problem is, how can I check the password that must be equal if I need to set the password first when I use "Password Entry"? How can I make password input field to display bullet font when users type password?
        • 1. Re: Problem about password input field
          Chunick Level 3
          here's a password font: http://www.chunick.com/director/password_font.zip

          here's the code I use with it:
          -- © Josh Chunick 2007
          -- this behavior script works with the password font
          -- to stop the user from being able to copy the text
          -- from the textbox. It does allow the paste function
          -- to still work, however.


          -- Base password behavior
          -- can paste, but not copy.
          -- uses the password font
          -- default text (which clears when focus is set on sprite
          -- when Enter key is pressed use sendSprite call


          property pAllowableChars
          property pMinLength
          property pMaxLength

          on getPropertyDescriptionList
          dList = [:]

          dList[#pAllowableChars] = \
          [#default: "01234567890!@#$%^&*().-_=+abcdefghijklmnopqrstuvwxyz", \
          #format:#string, \
          #comment: "Allowable Characters:" \
          ]

          dList[#pMinLength] = \
          [#default: 3, \
          #format:#integer, \
          #comment: "Minimum Length:", \
          #range: [#min: 3, #max: 10] \
          ]

          dList[#pMaxLength] = \
          [#default: 20, \
          #format:#integer, \
          #comment: "Maximum Length:", \
          #range: [#min: 10, #max: 50] \
          ]

          return dList

          end

          property mem

          on beginSprite me
          mem = sprite(me.spriteNum).member
          mem.editable = true
          mem.wordWrap = false
          mem.boxType = #fixed
          end

          on enterFrame me
          if (the keyboardFocusSprite = me.spriteNum) then
          if (the controlDown) and (keypressed("v")) then
          the editShortCutsEnabled = true
          else
          the editShortCutsEnabled = false
          end if
          else
          if (the editShortCutsEnabled = false) then
          the editShortCutsEnabled = true
          end if
          end if
          end

          on keyDown me
          case the keyCode of
          51, 117, 123, 124, 125, 126: -- Backspace, Delete, arrow keys
          sendAllSprites(#getKeyPressed, the keyCode, 1)
          pass
          115, 116: -- Home, Pg Up
          mem.selection = [0, 0]

          119, 121: -- End, Pg Down
          cnt = mem.char.count + 1
          mem.selection = [cnt, cnt]

          otherwise

          case (TRUE) of
          -- enter or return keys are pressed
          (the key = ENTER), (the key = RETURN):
          sendAllSprites(#submitLogin)

          -- max length is reached
          (mem.char.count >= pMaxLength):
          sendAllSprites(#getKeyPressed, the keyCode, 0)
          beep
          exit

          -- valid chars or valid character count is 0
          (pAllowableChars contains the key), (pAllowableChars.char.count = 0):
          sendAllSprites(#getKeyPressed, the keyCode, 1)
          pass

          -- anything else, beep (invalid)
          otherwise
          sendAllSprites(#getKeyPressed, the keyCode, 0)
          beep
          exit
          end case

          end case

          sendAllSprites(#getKeyPressed, the keyCode, 1)

          end


          -------------------------------------------
          -- PUBLIC FUNCTIONS
          -------------------------------------------
          on getPassword me
          return mem.text
          end

          -------------------------------------------
          • 2. Re: Problem about password input field
            light_shadow Level 1
            Thank you for helping me.