Forum Topic: AS: Password

(5,781 views • 58 replies)

This topic is 2 pages long. [ 1 | 2 ]

<< < > >>
None

Dancing-Thunder

Reply To Post Reply & Quote

Posted at: 6/29/05 09:40 PM

Dancing-Thunder NEUTRAL LEVEL 04

Sign-Up: 04/19/05

Posts: 278

AS: Main

This is a code that is very simple to make and allows you to have passwords for your games. Why would you want to have passwords? Well, if you're making a game, it acts like a save alternative. In a 5 level platformer game, you really don't need a save feature but a password feature would be helpful. If you are making a site in flash, passwords will keep people from accessing certain parts of your site that only you and other admins can access. So open up flash and lets get started! What you need to do first, is create a textbox that you want to be the spot for people to enter their password. Then, once you have that done, go to the document properties and make sure that the textbox is in "input text" format. After you have done that, change the variable name to "password" without the quotes. Then, (this is optional) go to the little box where it says "single line" and change that to "password". Now, create the submit button that you want the user to press after he/she has inputed the password. Give it these actions:

on (press) {
if(_root.pass=="password") {
gotoAndPlay (2);
}else {
gotoAndPlay (3);
}
}

Remember, you can change on (press) to on (release). To change the password from "password" to what ever you want, change password to what ever you want (except numbers) and make sure it's between the quotes. You can also change 2 and 3 to whatever frame numbers you want. If you want a number password, remove the quotes around password and add a number. Test your movie and you will see that you can enter your password and it will take you to frame 2. The else statement is basically saying that if the password is wrong, it will go to the "wrong frame". Oh, if you don't want people to cheat your password, add this code on the first frame of the main timeline:

Stage.showMenu=false;

That will disable the right-click options from your movie. I hope this helps you with your future games/movies!


None

Dancing-Thunder

Reply To Post Reply & Quote

Posted at: 6/29/05 10:05 PM

Dancing-Thunder NEUTRAL LEVEL 04

Sign-Up: 04/19/05

Posts: 278

Ahh! Error! Change the variable name of "password" to "pass"


None

Denvish

Reply To Post Reply & Quote

Posted at: 6/29/05 10:10 PM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,236

At 6/29/05 10:05 PM, Dancing-Thunder wrote: Ahh! Error! Change the variable name of "password" to "pass"

You mean:

on (press) {
if(_root.password=="PIE_IS_NICE") {
gotoAndPlay (2);
}else {
gotoAndPlay (3);
}
}

- - Flash - Music - Images - -

BBS Signature

None

Dancing-Thunder

Reply To Post Reply & Quote

Posted at: 6/29/05 10:11 PM

Dancing-Thunder NEUTRAL LEVEL 04

Sign-Up: 04/19/05

Posts: 278

At 6/29/05 10:10 PM, Denvish wrote:
At 6/29/05 10:05 PM, Dancing-Thunder wrote: Ahh! Error! Change the variable name of "password" to "pass"
You mean:

on (press) {
if(_root.password=="PIE_IS_NICE") {
gotoAndPlay (2);
}else {
gotoAndPlay (3);
}
}

Either way works, you can change the var name to pass or you can do what you did. XD


None

BleeBlap

Reply To Post Reply & Quote

Posted at: 6/29/05 10:30 PM

BleeBlap LIGHT LEVEL 24

Sign-Up: 03/08/05

Posts: 944

While passwords are nice for games and can be helpful for restricting sections on your site, I wanted to warn everybody not to put any sensitive material behind a Flash password. 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. Anyway, the tutorial was good, this was just a friendly reminder to those who didn't already know.


None

Bkid001

Reply To Post Reply & Quote

Posted at: 6/30/05 01:16 AM

Bkid001 NEUTRAL LEVEL 10

Sign-Up: 05/25/04

Posts: 274

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


None

Denvish

Reply To Post Reply & Quote

Posted at: 6/30/05 02:59 AM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,236

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.

- - Flash - Music - Images - -

BBS Signature

None

BleeBlap

Reply To Post Reply & Quote

Posted at: 6/30/05 03:05 AM

BleeBlap LIGHT LEVEL 24

Sign-Up: 03/08/05

Posts: 944

And the swf can still be viewed? This has to be too good to be true! If I ever actually start publishing my stuff, I think it will give it a go. If anybody else tries it before then, let us all know.


None

Toast

Reply To Post Reply & Quote

Posted at: 6/30/05 05:13 AM

Toast DARK LEVEL 09

Sign-Up: 04/02/05

Posts: 8,916

Dancing thunder,I think you should calm down with your AS: threads and put more effort into them.Look at other people's ASs,Joe,BleeBlap,Denvish,etc..I bet they barely had any caracters left to their posts because they are very explanatory and teaching.
No offence,but I have an impression that your AS thread don't teach anything but a code.
Perhaps there should be rules for making AS threads,this is my idea of a AS thread:

Title

introduction
:blah blah blah

Why and when to use it
:stuff

How to use it
:code and explaantions


Happy

Thomas

Reply To Post Reply & Quote

Posted at: 6/30/05 05:37 AM

Thomas LIGHT LEVEL 13

Sign-Up: 02/14/05

Posts: 2,833

Here's another password way if you wanna use it...

Paste this to a button next to an input text box for the password enter thingy...

on (release) {
if (lvl3 == "hopskip") {
_root.gotoAndPlay("lvl 3");
}
}

change lvl3 to the variable of your input box,and change "lvl 3" to the frame number or lable for it.Type in hopskip on my second boxing game in the 3rd box and you should be sent to the 3rd lvl :)


None

Thomas

Reply To Post Reply & Quote

Posted at: 6/30/05 05:38 AM

Thomas LIGHT LEVEL 13

Sign-Up: 02/14/05

Posts: 2,833

Oh,yours is probably better...mine doesn't have the thing for if your password is wrong.


None

Toast

Reply To Post Reply & Quote

Posted at: 6/30/05 05:39 AM

Toast DARK LEVEL 09

Sign-Up: 04/02/05

Posts: 8,916

At 6/30/05 05:37 AM, WaterBottleClock wrote: on (release) {
if (lvl3 == "hopskip") {
_root.gotoAndPlay("lvl 3");
}
}

Uhh..Dude,it's the same password that Dancing Thunder gave except that it doesn't have the else function...


None

Thomas

Reply To Post Reply & Quote

Posted at: 6/30/05 05:42 AM

Thomas LIGHT LEVEL 13

Sign-Up: 02/14/05

Posts: 2,833

on (press) {
if(_root.pass=="password") {
gotoAndPlay (2);
}else {
gotoAndPlay (3);
}
}

...no,I don't think so.He's got a double gotoAndPlay(); AS.


None

Inglor

Reply To Post Reply & Quote

Posted at: 6/30/05 07:40 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

now, you're not encrypting your passwords, anyone can decompile your flash and get your top secret passwords out, get the flash cryptography extention and md5 all your passwords and compare them to md5 text.


None

Toast

Reply To Post Reply & Quote

Posted at: 6/30/05 07:44 AM

Toast DARK LEVEL 09

Sign-Up: 04/02/05

Posts: 8,916

At 6/30/05 05:42 AM, WaterBottleClock wrote: ...no,I don't think so.He's got a double gotoAndPlay(); AS.

No.It's not a "double gotoAndPlay",it's the else function.That;s what I said.
it makes that if the password is NOT pass,it goes to frame number 2.


None

Dancing-Thunder

Reply To Post Reply & Quote

Posted at: 6/30/05 09:40 AM

Dancing-Thunder NEUTRAL LEVEL 04

Sign-Up: 04/19/05

Posts: 278

Sorry I made this stupid thread. I will think before I make another one.


None

Inglor

Reply To Post Reply & Quote

Posted at: 6/30/05 09:43 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

At 6/29/05 10:10 PM, Denvish wrote: some code

just a small meaningless fix

on (press) {
if(_root.password === "PIE_IS_NICE") {
gotoAndPlay (2);
}else {
gotoAndPlay (3);
}
}

and while I'm at it

on(press){
gotoAndPlay(2+(_root.password === "PIE_IS_NICE"));
}

1 line ;)


None

Denvish

Reply To Post Reply & Quote

Posted at: 6/30/05 09:44 AM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,236

At 6/30/05 07:40 AM, Inglor wrote: now, you're not encrypting your passwords, anyone can decompile your flash and get your top secret passwords out, get the flash cryptography extention and md5 all your passwords and compare them to md5 text.

I'm feeling lazy... link?

- - Flash - Music - Images - -

BBS Signature

None

Inglor

Reply To Post Reply & Quote

Posted at: 6/30/05 09:48 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948


None

Inglor

Reply To Post Reply & Quote

Posted at: 6/30/05 09:53 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

on(press){
if(Hash.hex_md5(_root.password)=="5d41402abc4b2a76b9719d911017c592"){
trace("omg j00 guessed teh password");
}
}

the password is "hello" here btw


None

Bkid001

Reply To Post Reply & Quote

Posted at: 6/30/05 03:05 PM

Bkid001 NEUTRAL LEVEL 10

Sign-Up: 05/25/04

Posts: 274

ok, so i got that mxp file...so wat do you do with it? remember I=new at flash and AS, so i got no idea how to do alot of things...>_<


None

Inglor

Reply To Post Reply & Quote

Posted at: 6/30/05 03:14 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

double click it or open it with macromedia extention maneger


None

Inglor

Reply To Post Reply & Quote

Posted at: 6/30/05 05:43 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948


None

redarmy1

Reply To Post Reply & Quote

Posted at: 7/8/05 04:00 AM

redarmy1 EVIL LEVEL 04

Sign-Up: 04/27/05

Posts: 53

i dont know if you are allowed to ressurect threads but is it possible to put different password possiblities on one thing like if you type in crazymonkies and thats the password for level 1 then is it possible on the same password thing to have a different password u could type in that would take u to level2

sry for the blurred description but plz help and for the ressurection of this thread


None

BleeBlap

Reply To Post Reply & Quote

Posted at: 7/8/05 04:22 AM

BleeBlap LIGHT LEVEL 24

Sign-Up: 03/08/05

Posts: 944

I hate to keep you running around in circles in the AS threads, but the explaination lies within the if / else statement explained here: AS: Conditions and Loops.


None

Denvish

Reply To Post Reply & Quote

Posted at: 7/8/05 04:35 AM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,236

At 7/8/05 04:00 AM, redarmy1 wrote: i dont know if you are allowed to ressurect threads but is it possible to put different password possiblities on one thing like if you type in crazymonkies and thats the password for level 1 then is it possible on the same password thing to have a different password u could type in that would take u to level2

Sure. Adaptation of Thunder's code (input text box has the VAR: "PIE")

on (press) {
if(_root.PIE=="password1"){
gotoAndPlay(2);
}else if(_root.PIE=="password2"){
gotoAndPlay(3);
}else if(_root.PIE=="password3"){
gotoAndPlay(4);
}else{
gotoAndStop(1);
}
}

Alternatively, you could use an array to hold passwords. Put this on frame 1:

Password_Array = new Array("password1", "password2", "password3");

Then this on the button:

on(press){
for(i in _root.Password_Array){
if(PIE==_root.Password_Array[i]){
_root.gotoAndStop(i+1); //or whatever
}
}
}

- - Flash - Music - Images - -

BBS Signature

None

<deleted>

Reply To Post Reply & Quote

Posted at: 8/19/05 02:15 PM

HM... U see errors.
Wow, I thode that peoples knows this...I will have to put it to my tutorial(next one).


None

SpamBurger

Reply To Post Reply & Quote

Posted at: 8/19/05 02:17 PM

SpamBurger NEUTRAL LEVEL 15

Sign-Up: 07/12/05

Posts: 4,747

At 8/19/05 02:15 PM, ninojoj wrote: HM... U see errors.
Wow, I thode that peoples knows this...I will have to put it to my tutorial(next one).

I didnt see any erros. And, why are you bumping this topic just to say that?

"However, the game received only two orders, one of which Molyneux speculated was from his mother." -Peter Molyneux's first game The Entrepreneur


None

Propell

Reply To Post Reply & Quote

Posted at: 8/27/05 08:09 PM

Propell LIGHT LEVEL 29

Sign-Up: 08/28/04

Posts: 58

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?


None

Bi0Reaper

Reply To Post Reply & Quote

Posted at: 8/27/05 08:12 PM

Bi0Reaper EVIL LEVEL 12

Sign-Up: 06/24/05

Posts: 363

How do you put it to input text format?

Whoever manages the site needs to put in linkable signatures, IE you put in the URL of the image, and it loads when the page does. For gamercards and such. Think about it.


All times are Eastern Standard Time (GMT -5) | Current Time: 08:41 PM

<< Back

This topic is 2 pages long. [ 1 | 2 ]

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!