Download .fla HERE
-Click HERE to see the .swf
(username: user password: pass)
Make a New Flash Document,
insert two keyframes, and place this code into both of them:
stop();
Now, select the first keyframe and
make a input textfield, open the properties(F9), and do like this:
Text Type : Input Text
Text Font/Size/Color : Verdana / 10 / black
Var : username
Line Type : Singel line
And select " show border around text"
Make another:

Text Type : Input Text
Text Font/Size/Color : Verdana / 10 / black
Var : pw Line Type : Password
And select " show border around text"
Now, make a dynamic text field and set the var. to "error" :

Ok, now draw a button like this:
Select it, press F8, choose button and name it submit.
Goto frame two on the main stage and write something like "secret stuff",
go back to frame one and select the button, now press F9 twice and paste this code into it:
on(press){
var msg:String = "Wrong password and/or username";
if(_root.username == "user" && _root.pw == "pass"){
gotoAndPlay(2);
}
else{
output =(msg);
}
}
Now your username is "user" and your password is "pass",
press Ctrl+Enter to test! =D
You can also create a button to clear all text fields,
just paste this code into it:
on(release){
_root.output = "";
_root.pw = "";
_root.usern = "";
}
That's all! Enjoy your password protection! =D
Remember that this is NOT very safe! so don't use it to protect important stuff!
UPDATE!
If you right-click and select play, you will go to nextframe(the "protected" one), to remove this menu:
Open your .fla, go to File>Publish Settings, select the HTML tab and
deselect "display menu".
Now, press publish and you will get a html file in the save directory.
Open this and the menu are gone ;)
discuss this topic to forum
