Hack an actionscript password field?
I have this simple actionscript 2.0 code for a password field.. you have to enter "hello" to get the string "yes" otherwi开发者_运维技巧se you get the string "no" returned.. I was wondering if there were any flash terms you could enter into the input text field to still get access other than "hello"
i.e. entering passwordstring would make the if statement say (read the code at the bottom first)...
if(passwordstring == passwordstring)
but that doesn't work..
here is my code:
passwordstring = "hello"
_root.onEnterFrame = function()
{
if(textfield.text == passwordstring)
{
trace("yes");
}
else
{
trace("no");
}
}
if(passwordstring == passwordstring)
This line will try match a property passwordstring
against another property passwordstring
. Entering "passwordstring"
into the text-field will not be the same as this, as it would read if("passwordstring" == passwordstring)
which would evaluate to false
.
For example this would evaluate to false
:
var value:String = "abc";
trace("value" == value); // false
Perhaps simply use a normal textfield but use pwd_txt.displayAsPassword = true;
Here is an another example also, http://marianomike.com/2009/03/18/easy-flash-as3-password-validation/
精彩评论