00:00
00:00
Newgrounds Background Image Theme

Kiitenlit just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS: Password

10,654 Views | 53 Replies
New Topic Respond to this Topic

Response to AS: Password 2005-10-01 15:03:48


At 8/27/05 08:09 PM, Bloody_angle wrote: when i write in my password i only want too see stars like this: ****** so ppl cant see what im writing... how do i do this?

click on the imput text and change the tab saying "single line" to password then it will appear as stars

Response to AS: Password 2005-11-18 21:55:13


this didnt help me at all .. where do i add the AS? in a button? any password it would play

Response to AS: Password 2005-11-19 04:25:09


At 8/27/05 08:09 PM, Bloody_angle wrote: when i write in my password i only want too see stars like this: ****** so ppl cant see what im writing... how do i do this?

If you check the properties of your text box there should be an option to set it to password which means it will only show *s

Response to AS: Password 2005-11-19 04:26:35


dammit sorry i didnt see the second page

Response to AS: Password 2005-11-19 07:14:46


At 8/27/05 08:12 PM, Bi0Reaper wrote: How do you put it to input text format?

In the properties bar change it from Static or Dynamic to Input :P

And here is a good tutorial on how to make text fields using only AS, thought it could be good if you want this password thingy only in AS:
AS: Text Fields by guywithhiscomp =D


BBS Signature

Response to AS: Password 2005-11-19 08:00:18


I've just created a simple password system using numbers. All you need to do is put the password into an array in TEXT FORM, so the password 1337 would become:

var aPassW:Array = ["one", "three", "three", "seven"]; //the password can be as long as you want, and you can use any number from 0-9.

Then my custom class which I created called NumberString will convert the array to a string that will contain the words in numerical form ("1337") and then the password is checked by converting the password string and the inputted password back into text and checking if they are equal :)

I did it just now because I was bored, and I kinda like it =P Simple to use, here is an example of it, you may have to right click and save as. The password is 15937.

This is how you use it:

var aPassW:Array = ["one", "five", "nine", "three", "seven"];
//aPassW is the password, remember TEXT FORM as shown
var secret:String = NumberString.convertArrTo(aPassW);
cont.onPress = function() {
//"cont" is the instance name of the password button
//"pswrd" is the instance name of the password text box.
if (NumberString.convertNumTo(pswrd.text) == NumberString.convertNumTo(secret)) {
//actions to do if password is correct
} else {
//actions to do if password is incorrect
}
};

And here is the class, to be saved as an .as file in the same directory of the .fla or in one of your class directorys.

class NumberString {
static var topNum:Number = 41;
static function convertTo(str:String):Number {
var numTexts:Array = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven", "twenty-eight", "twenty-nine", "thirty", "thirty-one", "thirty-two", "thirty-three", "thirty-four", "thirty-five", "thirty-six", "thirty-seven", "thirty-eight", "thirty-nine", "fourty"];
var numNums:Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
for (var a = 0; a<41; a++) {
if (str == numTexts[a]) {
return numNums[a];
}
}
return 0;
}
static function convertFrom(num:Number):String {
var numTexts:Array = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty-one", "twenty-two", "twenty-three", "twenty-four", "twenty-five", "twenty-six", "twenty-seven", "twenty-eight", "twenty-nine", "thirty", "thirty-one", "thirty-two", "thirty-three", "thirty-four", "thirty-five", "thirty-six", "thirty-seven", "thirty-eight", "thirty-nine", "fourty"];
var numNums:Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
for (var a = 0; a<41; a++) {
if (num == numNums[a]) {
return numTexts[a];
}
}
return "NaN";
}
static function convertArrTo(arr:Array):String {
var coll:String = "";
for (var a = 0; a<arr.length; a++) {
coll += (convertTo(arr[a])).toString();
}
return coll;
}
static function toArray(str:String):Array {
var arr:Array = [];
for (var a = 0; a<str.length; a++) {
arr.push(str.charAt(a));
}
return arr;
}
static function convertNumTo(str:String):String {
var b:String = "";
var str2 = toArray(str.toString());
for (var a = 0; a<str2.length; a++) {
b += convertFrom((str2[a]));
}
return b;
}
}

Some of that isn't needed, but I didnd't make the class (which is unfinished) specifically for this.


Sup, bitches :)

BBS Signature

Response to AS: Password 2005-11-30 18:28:34


Nicer way of doing it:

//Create a textbox with the instance name "Imput"
on (press) {
if(_root.imput.text == "PIE_IS_NOT_NICE") {
imput.text = "The password you entered was invalid" /*Or whatever..*/
}else {
gotoAndPlay (_root.imput.text);
/*I'm not really sure if this works but name your frames with the password and check it. If it doesint work just put a frame in the gotoAndPlay box.*/
}
}

Response to AS: Password 2006-01-30 16:13:54


At 6/30/05 09:53 AM, Inglor wrote: on(press){
if(Hash.hex_md5(_root.password)=="5d41402a

bc4b2a76b9719d911017c592"){

trace("omg j00 guessed teh password");
}
}

the password is "hello" here btw

Sorry for the bumb, but I could use some assistance on this.

For reasons unknown, I can't get the md5-encryption to work on my code and I really need for a little system I currently work on. Even if I add the #include md5.as, it still doesen't work. Perhaps I'm missing something of sum.

Feeling a bit n00bish right now, but for some odd reason, I can't get it to work. So can some1 gimme a hand ? :)


Internet is in danger |[]| Proof of the plans to destroy the internet.

BBS Signature

Response to AS: Password 2006-04-30 10:06:17


i know im gonna sound kind of stupid, but whats a variable name and where do i type it in? is it like an instance name?

Response to AS: Password 2006-04-30 10:24:40


At 4/30/06 10:06 AM, dan871 wrote: i know im gonna sound kind of stupid, but whats a variable name and where do i type it in? is it like an instance name?

If you don't know. Then you don't know x)

All code goes into the actions panel (hit f9 to show/hide)

If you want a variable to be shown in a textbox (which i think you want), make a textbox, goto the properties panel, make it "dynamic text" or "input text", and then put the variable name in the section labeled "var".

Dynamic means that you can only see the variable on screen, and input means that you can change the variable on screen.

AS: Password


SIG YOINK!

BBS Signature

Response to AS: Password 2006-05-31 19:11:56


At 8/27/05 08:09 PM, _Doenken_ wrote: when i write in my password i only want too see stars like this: ****** so ppl cant see what im writing... how do i do this?

In the Properties Inspector, change the box from 'single line' to 'password'.

At Sometime, Somebody Daid:
How do you put it to input text format?

Go to the Properties Inspector and make it one, retard.

You lazy asses should've tried FOLLOWING DIRECTIONS. You don't have to pay anything!


Lolz my club got deleted :p XP

Response to AS: Password 2006-05-31 19:14:59


Sorry, everybody. I didn't see the second page....


Lolz my club got deleted :p XP

Response to AS: Password 2006-06-01 05:14:38


At 6/30/05 09:43 AM, Inglor wrote:
on(press){
gotoAndPlay(2+(_root.password === "PIE_IS_NICE"));
}

1 line ;)

What's the '===' operator?

Is that new? (I.e. after Flash 5)

Response to AS: Password 2006-10-21 16:22:22


I have an MC called "cheat_menu" with 2 frames in it. 1st on is blank, and the second has an input text box and a submit button. "cheat_menu" has this code on it:
onClipEvent(enterFrame){
if(Key.isDown(Key.TAB)){
this.gotoAndStop(2);
}
}

If the [Tab] key is pressed, the cheat menu will pop up.

Next to cheat_menu, I have a dynamic text with a var name of "health". And on the main frame I have this code:
health=100

Inside cheat_menu the input text box has a var name of "pass", and on the submit button I have this code:
on (release) {
if (password eq "password") {
health+= 100;
}
}

The idea is that once I type in "password" into the input box, the player's health would get 100 points added to it. The problem is that I cannot get it to work.

Any thoughts?

Response to AS: Password 2007-06-20 13:32:13


you should of reserched before posting an error


Have any questions Email me or

PM me on Newgrounds

BBS Signature

Response to AS: Password 2007-07-10 09:55:21


At 5/2/06 11:44 AM, BlueFlameSkulls wrote: I have a simple problem

I have used the exact code for a password, an input text box, all correct names and variable and it won't work

Instead of going to a "passed" frame when correct password is inputted it goes to the "failed" frame. Whatever you input will go to the failed frame. I've stopped all frames and checked the script and everything seems fine.

Link to fla: (excuse the crudeness)

http://www.4shared.c..5/dc6e14db/pass.html

I have a problem like this, except when I uncheckes the box next to the variable thing, it still wouldn't work. this is the code:

on (press) {
if(_root.password=="nostril"){
gotoAndPlay("Scene 3",1)
}else
gotoAndStop(5);
}

Does it not work with scenes?

Response to AS: Password 2007-11-01 00:46:15


At 6/30/05 01:16 AM, Bkid001 wrote: what about that "protect from import" thing that you can check off...yet another password they'd have to get through...brute forcer ne one? XD

that won't stand a chance against everyday free .swf decompilers. it just stops you from importing it, not decompiling it.

Response to AS: Password 2007-11-01 16:38:25


I wouldn't trust any actionscript "encrypter". It merely obfuscates the code.
A quick debug session and it's quickly understood, no matter how many times the obfuscator have added needles computations.


Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.

Response to AS: Password 2007-11-11 10:11:35


Kinda late to bump this thread but It's for a good reason, I just need to make my pass non case-sensitive (actually it is not a password, it's more of a command for my game, so it isn't important the way it is spelled). How do I do this?


BBS Signature

Response to AS: Password 2007-11-11 10:36:32


At 6/30/05 02:59 AM, Denvish wrote:
At 6/29/05 10:30 PM, BleeBlap wrote: We all know swfs are easily decompileable, which means all of the passwords are visible to anybody who has internet access and a few minutes.
Funny you should say that, I found this today. I haven't tried it yet, but it might be the answer to a few Flashers' prayers.

Wow, you guys didn't know about this? How did you people think games like this could become successful if people could just modify the .swf?


BBS Signature

Response to AS: Password 2007-11-11 11:45:11


Help? Anybody?


BBS Signature

Response to AS: Password 2008-02-18 12:26:39


on (press) {
if(_root.password=="nostril"&_root.password2=="nostraight"&_root.password3=="yo mamma"){
gotoAndPlay("Scene 3",1)
}else
gotoAndStop(5);
}

try this =]


BBS Signature

Response to AS: Password 2009-08-16 18:46:31


on the text box properties there is a part that says behavior change it to password to make it look like that

Response to AS: Password 2009-08-16 19:21:29


This topic is over 4 years old, dude. Please check the dates.