Passwords for a chat room?

Hey, i’m doing a project for school. I have a flash chat room made by Colin Moock at www.moock.org, and i’m going to put it into another website so the owner can host scheduled chats. The idea is to sell the passwords so he makes money off of it. Is there a way i can make an if, then statement to check to see if the password is valid and then either let them in or deny access and to only use each password once (so two people coudn’t be on the same password at one time)? I was thinking somewhere along the lines of

if (password == //the passwords that he makes up)
then (gotoAndStop(accessGranted))
else (gotoAndStop(accessDenied))

does that sound like it would work? And how would I make Flash know where to look for the passwords and how to read it from the text field etc? I know this is kinda long, but i’m new to actionscript. Thanks!