I'm working on a puzzle like game where you need a password to get to the next level, but I am not sure how to make a password box. Can anyone tell me? Really apprecieate it, thanls guys.
Printable View
I'm working on a puzzle like game where you need a password to get to the next level, but I am not sure how to make a password box. Can anyone tell me? Really apprecieate it, thanls guys.
Make an input text field, and change it from "single line" to "password"? Or did I misunderstand you?
Thanks a lot! But how do I make it go to the next frame when the password is typed in?
create a button and do something like this
on(release){
if(mypasswordbox.text == "mypassword"){
_root.nextFrame(); //code if password equals
}else{
// add code if they dont equal;
}
}
Ok, I created a imput password text section, and turned it into a button, but it didn't work,.
I need more help, please and thanks!
Don't make the text like a button.
In the "var" field of the dynamic text, write "password".
Then you make a button (like "enter" or something), to which you attach this code:
(In this case, if you write the password which is "abc", it takes you to frame to when you click the button or press enter.Quote:
on(release, keyPress "<Enter>"){
if(password=="abc"){
gotoAndStop(2)
}
}
You can also use this code:
with just the keypress and make the button small and invisible.Quote:
on(keyPress "<Enter>"){
if(password=="abc"){
gotoAndStop(2)
}
}
Hope it'll help you!
Magnus
Thanks a lot man, I got it now! You're the best!!!
I test this code , but it doesn't work . I use this code :
Quote:
on(release, keyPress "<Enter>"){
if(password=="abc"){
gotoAndStop(2)
}
}
I observe notes , but it doesn't work ... .
I make a dynamic text and in the "var" field wrote "password" . Then I make a button and attach that code on it . I export my file in "swf" and open it . but when I type "abc" my flash doesn't go to frame 2 .
Please help me ! Thanks a lot .
My "fla" file : http://qommc.persiangig.com/password.fla
My "swf" file : http://qommc.persiangig.com/password.swf
It should be an Input Text Field instead of Dynamic Text Field.
Poltuda
Note: I'm using CS3.
Please answer
need your FLA to checkout what you are doing
I put them later , but also :
My "fla" file : http://qommc.persiangig.com/password.fla
My "swf" file : http://qommc.persiangig.com/password.swf
Thanks for your future help
Here you go
http://spamtheweb.com/ul/uploads/316...1_password.fla
Error #1:
Your password text field was 'dynamic text', I changed it to 'input text'.
I don't think people can input text into a dynamic text field.
Here's what each field is used for:
Static Text: Any text which will never be changed such as text telling a user what to do.
Dynamic Text: Text which can be changed by the use of actionscript. Such as a score or the addition of 2 numbers or a counter.
Input Text: A text field which a user can input text into. Such as a user/pass field.
Error #2:
You forgot to give your text field and instance name, so I named it 'pass'.
I also changed your password variable which was used for the text field in your button actionscript to 'pass', just to avoid any conflicts there may be with the flash 'password'. (I tend to change any variable which may appear blue which means its used by flash)
Error #3:
I'm not sure if this is an error but I moved your keyPress "<Enter>" into a seperate statement, I've personally never used that but it probably works, just never tested it.
Error #4:
You forgot to add the _root. part when making the if statement for your password field. This basically locates the text field as being on the stage level.
Here is an explanation of _root. this. and _parent.
http://www.kirupa.com/developer/acti...arent_this.htm
Error #5:
You also forgot .text after the password part..
It's a text field and you want to know what the text says, so you have to specify that.
So it now looks like:
_root.pass.text
If you wanted to move the position of the text field, you could use
_root.pass._x = 50;
(Not _root.pass.text._x)
Error #6:
You forgot the semicolon (; ) after the gotoAndStop(2)
Not sure if it's required all the time, seen people not using it but I prefer to.
Thanks a lot , thanks !
They were done and your FLA file can work .
Your guides were useful for me and my work .
Thank you , Farzad