Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Flash Component Label
cXtraStringGrid
MPEGXtra
Start Menu(xml)
Dialogs - Tell Me Something
ADOXtra Lite
MagicTools Xtras
Lower Case
Magnify-Alphamania
INSIDE Macromedia Director & Lingo
MediaMacros Xtras Mall
 

 

 

Behavior Password Field

Added on 7/8/1999

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

Rating:

Author: MediaMacros (website)

Use this on a field to require password access to a projector. Paramaters include the correct password, where to go if correct, and the number of allowed attempts.

--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know.  :-)

property spriteNum, password, theMarker, tries, currentword, totaltries

on beginSprite me
  tries = 0
  currentword = ""
  sprite(spriteNum).member.text = ""
  sprite(spriteNum).member.editable = true
end

on keyDown me
  if tries = void then tries = 0
  if the key = return then
    dontpassevent
    if currentword = password then
      go theMarker
    else
      alert "Incorrect password."
      tries = tries + 1
      if tries >= totaltries then
        alert "Invalid User"
        quit
      end if
      currentword = ""
      sprite(spriteNum).member.text = ""
    end if
  else
    dontpassevent
    if the keycode = 51 then
      if currentword.char.count > 1 then
        howMany = (currentword.char.count - 1)
        put howmany
        currentword = currentword.char[1..howmany]
      else
        currentword = ""
      end if
    else
      if "1234567890abcdefghijklmnopqrstuvwxyz-. " contains the key then
        currentword = currentword & the key
      end if
    end if
    theText = ""
    if currentword.char.count > 0 then
      repeat with x = 1 to currentword.char.count
        thetext = thetext & "*"
      end repeat
    end if
    sprite(spriteNum).member.text = thetext
  end if
  
end

on getPropertyDescriptionList me
  p_list = [:]
  addProp p_list, #password, [#format : #string, #default : "myPassword", #comment : "The password:"]
  addProp p_list, #theMarker, [#format : #marker, #default : #next, #comment : "Where to go if correct:"]
  addProp p_list, #totaltries, [#format : #integer, #default : 4, #comment : "Number of tries:"]
  return p_list
end

on getBehaviorDescription me
  return "Use this on a field to require password access to a projector.  Paramaters include the correct password, where to go if correct, and the number of allowed attempts."
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail