Start the Flash program. Click "Flash File(ActionScript 3.0)" from the splash window to create a new file for the AS3 Flash multiple drop target project.
Select "Actions" from the "Window" menu on the main Flash menu bar to open the ActionScript 3.0 editor. Position your mouse cursor on the first line of the ActionScript 3.0 editor. Click your mouse button and type in the code below to create the text fields in the Flash movie that will be used to enter the username and password.
var userName:TextField = new TextField();
userName.x = 10;
userName.y = 10;
userName.width = 500;
userName.height = 380;
addChild(userName);
var user_Password:TextField = new TextField();
user_Password.x = 10;
user_Password.y = 40;
user_Password.width = 500;
user_Password.height = 380;
addChild(user_Password);
The "var" statements create two TextFields, one named "userName" and the other named "user_Password." The placement of the TextFields is accomplished by attaching an "x" and a "y" position property to the name of the TextFields. The addChild methods are needed to display the TextFields on the Flash stage.
Type the code starting at the next line of the ActionScript 3.0 editor to create a header to send to the server where your website is located. Use AS3 code to specify the name of the program that will receive the variable names and variable values (the TextFields' variable names and the text entered into the the TextFields).
var URL:String = "http://yourdomanname.com/server_side_processing.php";
var request:URLRequest = new URLRequest(URL);
var variables:URLVariables = new URLVariables();
variables.user_name = userName.text
variables.password= user_Password.text
request.data = variables;
The code above constructs a header that is stored in the "request" URLRequest variable. The code places the name of the domain, the directory path of the file, the name of the file to send the data to (all of which are stored in the string variable named "String") as well as the URL variable names and URL variable values of the TextFields into the header. The "request.data:" statement concatenates and sends that data to the file named server_side_processing.php.