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_1

onLoad () {
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 Button

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

Latest Submissions

Site Overview

swish-designs.co.uk
relies on donations and purchases from users
to enable too keep this site running. as the site has grown in its content and reputation so has the cost of keeping this site going, thank you to all who help and have helped me achieve this goal. still many files are offered for free in the download center to help others learn and understand swishmax.
however files that acompany tutorials have a download fee as do shop files which help towards the the sites running costs, happy swishing.


Contact Me

You can use the following information
to either find or contact me.

Blog:www.loweonline.co.uk
Facebook: Facebook Group
E-mail: craig@swishdesigns.co.uk

Find Me At

Swishzone:Find Me There
Loweonline: Find Me There