Welcome, Have a Nice Friday
Login with Register New Account Feature - Swishmax
Learn how to create a login with registration feature no database required.
First Of All
You will need the latest build of swishmax installed on your Computer for this to work.
open swishmax and set the canvas size to 200 x 150 pixels and a frame rate of 25fps.
Step.1
Using the Text Tool select static text and type Username press enter twice and type Password rename the text file to names see fig.1 below.
Fig.1
Step.2
Using the text tool again select input text and drag out a text box to enter the username into, rename the item to Username and give it a variable name of loginname, now do the same again but this time for the password to be entered into, rename the item Password and give it a variable name of loginpass
see fig.2 below.
Fig.2
Step.3
You now need to select the bezier tool and choose solid line with a colour of #CCCCCC, then using the Bezier tool draw a line accross the bottom left to right and up the right hand side of each input box, this will then make the input boxes look indented.
see fig.3 below for a demonstration.
Fig.3
Step.4
Now create two buttons one for the Login and one for the Register these can be any style or colour you want them to be, see fig.4 below.
Fig.4
Step.5
using the text tool create a dynamic text box and place the width of the movie, just underneath the buttons like in the example at the begining of the tutorial, name the item news and give it a variabl name of status and select the text to be centered see fig.5 below
Step.6
Now Add the following code to Scene_1onLoad () {
loadVariables("auth.txt");
loginpass="";
loginname="";
status="";
}
onFrame (2) {
if (txtloaded!="OK") {
prevFrameAndPlay();
}
stop();
}
onFrame (3) {
status = "Wrong Data Entered";
}
onFrame (4) {
stop();
}
Step.7
Now add the following code to the Login Button
on (release) {
if (_root.loginname== "" and _root.loginpass=="") {
status="wrong data entered";
if (eval(_root.username.text) eq _root.password.text) {
getURL("http://page_you_want_to_open.com","_blank");
} else {
status="wrong data entered";
}
}
}
Step.8
Add the following code to the Register Buttonon (release) {
if (loginname == undefined and loginpass ==undefined) {
if (eval(loginname) == undefined) {
trace(eval(loginname));
loadVariables("auth.php", _root, "POST");
} else {
status = "username already in use";
}
} else {
status = "all fields must be filled";
}
}
Ok thats it now for the swishmax side of things, save and export your project file, Remember all files assosiated with this project mustt all be in the same folder.
Step.9
Open up Notepad or your favourite text editing software, and type the following into it and save as auth.txt&Test=Test&
&username2=password2&
&username3=password3&
&username4=password4&
&txtloaded=OK&
Step.10
Open up Notepad again or your favourite text editor and add the following code to it and save as auth.php
Now press Ctrl+T to test your cloud in the player you should have something like in the example at the top of the page.
Back To Top
Remember yor hosting must support the use of php files for this to work, also chmodd the auth.txt to 777 all files in association to this project must be uploaded to the same folder.
i hope this tutorial has helped you in some way
Thank you for reading.
MY LINKS
Site Statistics
TOTAL: 11807
UNIQUE: 51341904
TODAY: 2018
About You
IP: 38.107.179.217
Town: Glendora
Country: US - United States
38.107.179.217
Flag:





