Developing Flash based applications with PHP

Here is a simple tutorial with step-by-step learning on how to connect make Flash based applications to interact with PHP programming- helping you to start and explore backend database driven Flash.

Step1 : Open Macromedia FlashMX, set the area as 200px and 20px.

Step 2 : Select the text tool from the Toolbox as shown in the figure below.

Flash_to_asp

Step 3 : After selecting the text tool from the properties menu, select the text tool  type as input text from the drop down menu.

Developing Flash based applications with PHP


Step 4 : Drag and draw a textbox using the same tool. 

Developing Flash based applications with PHP


Step 5 : To make the text tool area appear like a textbox, select the "SHOW BORDER AROUND TEXT".

Developing Flash based applications with PHP


Step 6 : Set the Var value for the textbox as t1. That is you are naming the text box as t1.

Developing Flash based applications with PHP


Step 7 : Draw a similar textbox again with a larger area. set the variable name for the text box as t2. Set the property for the second text box as Multi line as shown below.

Developing Flash based applications with PHP


Step 8 : Select the Rectangle tool from the toolbox. Draw a small rectangle.

Developing Flash based applications with PHP


Step 9 : Convert it into a button. After creating it into a button, right click the button and select Actions.

Developing Flash based applications with PHP


Step 10 : When you click the "Add new item to the script", Select Actions -> Movie Control -> on 

Developing Flash based applications with PHP

Step 11 : After selecting "on". A small window containing the following options will be listed. select the "Press " from the options. 

Developing Flash based applications with PHP


Step 12 : Now click (+} again. Select the Actions -> browser / Network -> getURL from the actions pane.

Developing Flash based applications with PHP


Step 13 : Now a small window asking for a few parameters to be filled will be prompted as shown below. Set the URL text to the page to which the data to be posted. example (submit.asp) for PHP users make it as(submit.php).

Developing Flash based applications with PHP


Select the window value as "_self " and the Variables value to be set as "Send using POST ".

Developing Flash based applications with PHP


Step 14 : Now export this to a .swf file.

Step 15 : Now create a php page save it as "submit.php". Paste the below given code.
<?php
$Nm=$_REQUEST["t1"];
$Comments=$_REQUEST["t2"];
$to = "admin <admin@example.com>";
$subject = "request from webmail";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: website enquiry <websiteenquiry@example.com>\r\n";
mail($to, $subject, $Comments, $headers);
?>
Now the submitted content would be sent as a email to the administrator.
enquiry@macronimous.com

articles

http://s9.addthis.com