Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author Miguel Panos
»  Title: Tarta
»  Description: It is a circle graph or pie chart that takes the data entered by user
»  More by Miguel Panos


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4839 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  AuthorDeft Creative Ltd
»  Link: Home Page
»  Description: Portfolio site for .DeftCreative Ltd. A UK based web design studio specialising in flash websites, games and interactive CDROMs. With an emphasis on making things different.


Random Links | Add your own Flash Related Links
Flash Tutorials 1484 Tutorials 7 New Tutorials Added!
What's New | Top100

» Making Automatic Training Screen Capture Easily
» Create Undersea Life Animation
» Making Deinterlace Video with a low bitrate Easily
» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Dynamic_Content

Categories Ultra Simple PHP Flash Login
Author: Alan Wisternoff | Website: http://www.buffoonbrothers.com |

 
Page 3
«prev 1 2 3

The Flash

You can make your flash file as simple or as complicated as you desire. You can look at my .fla if you need help but how your flash responds to the incoming variables is up to you. You do need some basic components to your flash file though.

1.) Two input text boxes, one for the user to input a username and the other a password. They both need variable names of "username" and "pass". Note In my swf at the start of this tutorial I have 3 fields, an extra one to confirm the password. Adding this is entirely up to you.

2.) Two buttons, one for registering new username and password combinations and another for logging in after registration is successful. The login button needs at least this code

on (release) {
loadVariablesNum("login.php", 0, "POST");
}


The register button needs at least this code

on (release) {
loadVariablesNum("register.php", 0, "POST");
}


But there is other code as well that is not mandatory but quite important. Firstly you must limit the possible characters inputted. This code on the main timeline will deal with that.

usernew.restrict = "a-zA-Z0-9";

This restricts the character entry to the instance of usernew (don't forget to give your username input textbox an instance name (usernew) as well as variable name) to letters of the alphabet (lower and uppercase) and the 10 digits. Do this for the password input textbox also and give it an instance name.

Maximum number of characters can be controlled using the textbox properties but making sure the user enters in a minimum number of characters can be coded for on the register button using an "if" statement.

if(username.length>= 6 && pass.length>= 6){
loadVariablesNum("register.php", 0, "POST");
}else{
_root.words = "Username must have between 6 and 12 characters.";
}


assuming you have set the maximum number of characters to 12.

Also it pays to check that something has actually been entered in the textboxes during login. On the main timeline set

username="";
pass="";

Then on the login button put

if (username != "" && pass != "") {
loadVariablesNum("login.php", 0, "POST");
}else{
_root.words = "Please enter a username and password";
}


If you want to look extra smart in the login and register buttons under the loadVariables command add

words="Processing..."

or something similar. You will need to add a dynamic textbox with the variable name, "words" to display all the feedback, both from the flash buttons as well as the php file. Finally check out the full working version at My Website and if you want to contact me use the flash form there also.

«prev 1 2 3

» Level Intermediate

Added: : 2007-02-03
Rating: 8.00 Votes: 17
Hits: 1591
» Author
Cycling, snowboarding, flash creator extraordinaire.
» Download
Download the files used in this tutorial.
Download (21 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments