Be a Supporter!

AS: Password

  • 7,302 Views
  • 56 Replies
New Topic Respond to this Topic
Dancing-Thunder
Dancing-Thunder
  • Member since: Apr. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
AS: Password 2005-06-29 21:40:51 Reply

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!

Dancing-Thunder
Dancing-Thunder
  • Member since: Apr. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to AS: Password 2005-06-29 22:05:32 Reply

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

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to AS: Password 2005-06-29 22:10:54 Reply

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
Dancing-Thunder
Dancing-Thunder
  • Member since: Apr. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to AS: Password 2005-06-29 22:11:52 Reply

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

BleeBlap
BleeBlap
  • Member since: Mar. 8, 2005
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to AS: Password 2005-06-29 22:30:54 Reply

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.

Bkid001
Bkid001
  • Member since: May. 25, 2004
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to AS: Password 2005-06-30 01:16:15 Reply

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

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to AS: Password 2005-06-30 02:59:56 Reply

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
BleeBlap
BleeBlap
  • Member since: Mar. 8, 2005
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to AS: Password 2005-06-30 03:05:43 Reply

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.

Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to AS: Password 2005-06-30 05:13:44 Reply

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


BBS Signature
Thomas
Thomas
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 13
Musician
Response to AS: Password 2005-06-30 05:37:24 Reply

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 :)


wat
a compessor wil raise the volume while lowering the db - chronamut

Thomas
Thomas
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 13
Musician
Response to AS: Password 2005-06-30 05:38:47 Reply

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


wat
a compessor wil raise the volume while lowering the db - chronamut

Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to AS: Password 2005-06-30 05:39:14 Reply

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...


BBS Signature
Thomas
Thomas
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 13
Musician
Response to AS: Password 2005-06-30 05:42:43 Reply

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

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


wat
a compessor wil raise the volume while lowering the db - chronamut

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to AS: Password 2005-06-30 07:40:29 Reply

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.

Toast
Toast
  • Member since: Apr. 2, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to AS: Password 2005-06-30 07:44:42 Reply

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.


BBS Signature
Dancing-Thunder
Dancing-Thunder
  • Member since: Apr. 19, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to AS: Password 2005-06-30 09:40:15 Reply

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

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to AS: Password 2005-06-30 09:43:35 Reply

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 ;)

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to AS: Password 2005-06-30 09:44:47 Reply

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
Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to AS: Password 2005-06-30 09:48:44 Reply

Enjoy ;)

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to AS: Password 2005-06-30 09:53:09 Reply

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

the password is "hello" here btw

Bkid001
Bkid001
  • Member since: May. 25, 2004
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to AS: Password 2005-06-30 15:05:32 Reply

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...>_<

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to AS: Password 2005-06-30 15:14:40 Reply

double click it or open it with macromedia extention maneger

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to AS: Password 2005-06-30 17:43:27 Reply

http://www.newgrounds.com/bbs/topic.php?id=298271

made a little helper ;)

redarmy1
redarmy1
  • Member since: Apr. 27, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to AS: Password 2005-07-08 04:00:27 Reply

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

BleeBlap
BleeBlap
  • Member since: Mar. 8, 2005
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to AS: Password 2005-07-08 04:22:18 Reply

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.

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to AS: Password 2005-07-08 04:35:37 Reply

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
<deleted>
Response to AS: Password 2005-08-19 14:15:32 Reply

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

Propell
Propell
  • Member since: Aug. 28, 2004
  • Offline.
Forum Stats
Member
Level 32
Blank Slate
Response to AS: Password 2005-08-27 20:09:45 Reply

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?

Bi0Reaper
Bi0Reaper
  • Member since: Jun. 24, 2005
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to AS: Password 2005-08-27 20:12:11 Reply

How do you put it to input text format?


British Columbians: Speak out against the new meal tax or you'll be paying 7% tax on top of the 5% you already pay. http://www2.nomealtax.ca/

Propell
Propell
  • Member since: Aug. 28, 2004
  • Offline.
Forum Stats
Member
Level 32
Blank Slate
Response to AS: Password 2005-08-27 20:13:47 Reply

it wasnt too hard only chose password on propeties