rgroft
asked on
Can you have a required log-in password automatically change when a certain date happens?
I would like a login password to automatically change when a certain date rolls around.
Example: the required login password for 28/4/2009 is "password01". On 05/5/2009 the required password changes to "password02". I have about 15 passwords total. Is this possible? If so, how?
I have an Input Text box with the var: password. I have an Enter button with the code below attached to it.
Example: the required login password for 28/4/2009 is "password01". On 05/5/2009 the required password changes to "password02". I have about 15 passwords total. Is this possible? If so, how?
I have an Input Text box with the var: password. I have an Enter button with the code below attached to it.
//the enter button code
on(release, keyPress"<Enter>") {
if(password eq "somePassword") {
gotoAndStop("start");
} else{
gotoAndStop("wrong");
password = "";
}
}
I should add that if you are interested in security it would be better to do a remote procedure call or something similar to do the authentication server-side, but for the purpose of securing for the casual browser this will do fine.
In case it wasn't clear, the "btn.onRelease" function takes the place of your on(Release) code. It could also be placed on the button the same way you had it like so:
In case it wasn't clear, the "btn.onRelease" function takes the place of your on(Release) code. It could also be placed on the button the same way you had it like so:
on(release, keyPress"<Enter>") {
var result = checkPassword('pass4');
if(result) {
gotoAndStop("start");
} else {
gotoAndStop("wrong");
password = "";
}
}
ASKER
Hi there!
Thank you for getting back to me on this.
I placed your code in my FLA file but it isn't working. The trace says "false". I am assuming that I am doing something wrong. How can I get you an FLA to look at.
Sorry for being a pain on this.
Thank you in advance
Thank you for getting back to me on this.
I placed your code in my FLA file but it isn't working. The trace says "false". I am assuming that I am doing something wrong. How can I get you an FLA to look at.
Sorry for being a pain on this.
Thank you in advance
Are you able to upload the FLA somewhere for me to download? I think posting email addresses here is verboten :)
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much!
Your solution was perfect. I'm looking forward to studying it.
Your solution was perfect. I'm looking forward to studying it.
Note that when setting up the dates, the MONTH component is zero-based, so January is 0, Feb is 1, March is 2 and so on
eg: this element says that the password "pass1" is valid on or after 25th April 2009
{ date: new Date(2009,3,25), pass:"pass1" },
Open in new window