Adobe Flash Actionscript Flex Examples

Basic Example LoadVars
Using Flash UI Components And PHP

JavaScript and the latest version of the Adobe Flash Player are required. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

This is a basic example that uses Flash UI components and the LoadVars object to send data to a PHP script that responds back to Flash with the same data, the server time and what ther server sees as your web browser description. The trace window in the Flash movie will show the results.

The PHP script has a forced 3 second delay a technique used to observe the Flash movie during the time it is waiting for the response.

Files are configured to publish the LoadVarsPHPEx02_Request movie and its html file in the same folder on your PHP web server and to launch using http://www.yourphpserver.___/path_to_LoadVarsPHPEx02_Request.html/LoadVarsPHPEx02_Request.html.

If you want to test inside of the Flash IDE, then you need to change the last lines in frame 1 of LoadVarsPHPEx02_Request.fla to include http://www.yourphpserver.___/path_to_LoadVarsPHPEx02_Response.php/LoadVarsPHPEx02_Response.php. There are comments in LoadVarsEx02_Request.fla for this.

Key item to remember is that anything outside the PHP tags in LoadVarsPHPEx02_Response.php is returned and this is received by LoadVars. So no whitespace (tabs, spaces, returns characters of any type) outside of the PHP tags.

Downloads:
All source files for Flash MX2004: Download
All source files for Flash 8: Download
Search For More Flash Flex Actionscript Examples