Section 5th User Login System
Using flash forms can be used as landing portals for Web sites, as for the input of a specific user name and password, you can enter the site, this example to create a simple user login system, if the password and user name entered the same, you can log on to the Web site, if not the same, give a hint of information, Cannot log on to the website.
This login system interface is shown in Figure 5.1;
Figure 5.1 User Login System main interface
For example, we enter user in the username text box, and then enter use in the Password text box, automatically open the IE browser window, enter the Web site, if the password and username are not the same, give the error message as shown in Figure 5.2:
Figure 5.2 Error message
1. Start Flash first, set the movie stage size to 280px*200px (in pixels), the film background color is gray, color code for #cccccc.
2. Select the Text tool in the Toolbox, draw a text box on the top and bottom of the stage, set the text box type in the property panel as input text, text variable name, and other related settings as shown in Figure 5.3;
Figure 5.3 Setting the User Name text box
Also set the following text box type for the input text, the text variable named password, because this text box to enter a password, according to the regular form of the password entry should be displayed as an asterisk, so you need to specifically set the text box character type as a password, specific settings as shown in Figure 5.4;
Figure 5.4 Setting the Password text box
3. Then add the text message to the two text boxes and use the line tool to draw a square outline of the form as the boundary of the form, and the stage is shown in Figure 5.5:
Figure 5.5 Adding a message to a text box
4. Finally also need to add a Submit button to the form to submit the user input information, so as to determine whether the current user is legitimate users, draw a simple button here, and then drag it below the stage, as shown in Figure 5.6;
Figure 5.6 Adding a Submit button to a form
5. The final task is to add action to the Submit button, the script here to determine whether the user's input to meet the requirements, and then add the following action to the button;
On (release) {
if (password = = name) {
GetURL ("index.htm", "_self");
} else {
Name= ' password error ';
}
}