# Password protection

**URL:** <https://forum.kirupa.com/t/password-protection/658>\
**Category:** flash\
**Created:** [July 24, 2002, 10:54pm UTC](https://forum.kirupa.com/t/password-protection/658 "2002-07-24T22:54:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YoungMaster](https://avatars.discourse-cdn.com/v4/letter/y/f9ae1b/32.png) [@YoungMaster](https://forum.kirupa.com/u/YoungMaster)\
**Post date:** [July 24, 2002, 10:54pm UTC](https://forum.kirupa.com/t/password-protection/658/1 "2002-07-24T22:54:22Z")

</div>

if someone would look, Im just trying to put a “password” protection on a part of a site. I created a button, and attached that button with a script:

on (release) { if (\_root.password.value eq tommygun) { getURL(“secure.html”); } }

I want when they input the correct password, that they will be directed to the site. (there is more, but I just need to figure this out). any help would be most appreciated…and if someone has a much better way to do this…please tell…😃

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 25, 2002, 12:28am UTC](https://forum.kirupa.com/t/password-protection/658/2 "2002-07-25T00:28:15Z")

</div>

This should solve your problem.

on(release){  
if(textField.text == correctPass){  
Show status.text = “Password confirmed”;  
\_root.gotoAndPlay(“beginSite”);  
//or you can use this  
getUrl(“secure.html”);  
}else{  
Show status.text = “Error, try again!”;  
\_root.gotoAndPlay(“startAgain”);  
}  
}  
Hope this helps.

Kyle

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 25, 2002, 12:58am UTC](https://forum.kirupa.com/t/password-protection/658/3 "2002-07-25T00:58:51Z")

</div>

[Password Tutorial](http://www.actionscripts.org/tutorials/beginner/Password_protected_pages/index.shtml)  
🙂
