How??? Sorry i didn’t quite get it
I think what BSA means is refer to the text boxes value as “this.value”
Here’s how I would do it:
Add text box to canvas
Name the clip inside of textbox as “box”
Exit the clip, and add an update script to the textbox on the canvas
Refer to the value of the textbox as
this.box.value; /* Use to refer to value */
or
this.box.inputElem.value /* Use to change the value */
To create a password/ username system, I would create an array of possible passwords that you might wanna use, and one with usernames for every password (every password has its own username based on the array order).
project.passwords = ["PW1","PW2"];
project.usernames = ["UN1","UN2"];
You can add more passwords/ username to the array to add a new password or username
And then, I set project.password to the value of a text box, and project.username to another.
Next, I checked if the username is inside of the array and the password is the correct one
// When enter is clicked or player submits the info
if(isKeyJustPressed('enter')){
// If the username is part of the array
if(project.usernames.indexOf(project.username)!==-1){
// If the password is the correct one for this username
if(project.passwords.indexOf(project.password) === project.usernames.indexOf(project.username)){
// Correct password results
alert("welcome "+project.username);
}else{
// Incorrect password
alert("Incorrect password");
}
}else{
// Incorrect password or username
alert("Incorrect password or username");
}
}
Here’s an example:
Password_ Usernames1-29-2021_7-45-53.wick (5.6 KB)
i get an error on the textboxes, it says TypeError: this.model.project is null
Try this version:
Password_ Usernames1-29-2021_9-29-41.wick (6.6 KB)
Let me know if the error is still there
In this file you should be able to create an account by adding a username and password to the array of passwords and usernames.
Before the account is created, the program will have to check if the username is available, and if it’s a valid username and password (if username or password textboxes are empty, then it’s invalid).
If you save the password and username arrays on a server, then you would be able to log in using the username and password you created from any device.
Feel free to edit the file or use the code inside
is there any way to make it go to a new frame without the text poxes pointlessly sticking around, cause now it’s working fine!
Oh yes, I see, the unload script for the textboxes seems to not be working.
(@Jovanny reported this bug somewhere)
Here’s a fix:
Password_ Usernames1-29-2021_10-31-46.wick (6.9 KB)
It should take you to the next frame once you sign in or create an account
Edit:
I just changed the file so that when you pause the editor the text boxes don’t stay there either
The textinput called password is the place you make your password in and it detects if the text input where you type the password in = the password
still doesn’t work, can you examine what’s wrong?
systematix660a1-29-2021_12-14-30.wick (4.0 MB)
it says theres an error on line 7, there is no line 7
nvm its just the .3 revision, it works on 1.19.0, do you know where the scrips that goes to the next frame is?
Edit:
My bad, it’s inside of textbox2 box’s unload script
Project >> textbox2 >> box >> Unload Script
(You can probably move it elsewhere)
where in the default script?
i might stick to the old clunky way, this is too buggy and confusing for a supernoob like me, don’t take it personally.
Here, I removed the username textbox and all the code connected to it, let me know if this is what you needed:
Password_ 1-30-2021_7-31-33.wick (6.6 KB)
they already solved that
Ok, i decided to come back to this and it says the sign in button says error on line 10 in the mouseclick script, there is no line 10, it just says
project.SignIn();
Here’s The Frame code
project.passwords =
[
“uvio”,“systematix2”
];
stop();
project.Confirmed = function(){
textbox2.box.runScript(‘unload’);
playSound(“logon.wav”)
alert(“Welcome!”)
};
project.SignIn = function(){
if(project.passwords.indexOf(project.password)!==-1){
project.Confirmed();
}else{
alert(“Wrong Login Info”);
}
};
thatd be cool if you encrypted it