1. Home
  2. Computing & Technology
  3. Animation

Dynamic eCard with Flash and PHP

By Adrien-Luc Sanders, About.com

5 of 9

We’re going to use a basic getURL to open the page containing the eCard, but with a little twist:
on (release){
getURL(“http://www.yoursite.com/yourdirectory/yourfilename.php”,”_blank”,”GET”) ;
}
You’ll notice two things:
  • The filename that the getURL command is pointing to ends in .php, instead of .html or .swf. Because we’re embedding PHP code into the page that displays the eCard, it has to end in a valid PHP file extension.
  • The Variables field says Send using GET, and there’s a big ”GET” inside the code itself.
  • There are two methods of sending variables: GET and POST. GET can make for some messy URLs, as it appends the data to the URL called by the getURL function – but it’s quick and easy to call again later with little fuss. POST puts the data inside the HTTP headers of a file and can be a bit harder to call later. Both gather the values of all of the variables in the Flash movie, and send them wherever you tell them to go by appending them to the end of the url called in the following format:

    http://www.yourdomain.com/yourdirectory/yourfilename.php?varname=varvalue

    When more than one variable is sent, they’re concatenated using an ampersand.

    http://www.yourdomain.com/yourdirectory/yourfilename.php?varname=varvalue&variable2=secondvariablevalue
    Explore Animation
    About.com Special Features

    Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

    Easy ways to connect two computers for networking purposes. More >

    1. Home
    2. Computing & Technology
    3. Animation
    4. Flash Animation Tutorials
    5. Dynamic eCard with Flash and PHP

    ©2009 About.com, a part of The New York Times Company.

    All rights reserved.