GET vs. POST
There are two ways to transfer data between the server and Flash when working with server-side scripts: via GET or via POST. These two techniques for sending variables and their associated values are used in regular HTML pages and in Flash whenever data entered into a form is sent to a server to be processed. (We'll discuss the specific methods in the following exercises.)When you send variables using GET, you're simply concatenating variable name/value pairs onto the URL itself. For example, if you wanted to use GET to send my name and email address to a script located on the register.asp page, you'd specify the URL as follows:http://www.somedomain.com/register.asp?name=jobe&email=jobe@electrotank.comThe question mark (?) tells the script and server that everything that follows comprises variables. Although GET is easier to use than POST, it won't work for every situation because it has a 1024-character limit.Now let's take a look at how POST is used. When variable data is sent using POST, that data is contained within the header of the HTTP request, which means you cannot see it being transferred. This gives you an added layer of security since the variables are not easily read. Because POST doesn't have a character limit, it provides a slightly more versatile way of sending variable data.
We'll return to the topic of GET and POST in the exercise that accompanies the next section, "Using the LoadVars Class."NOTEBecause GET and POST are not always easily interchangeable, most server-side scripts are programmed to accept variables via either GET or POST, but usually not both.
• Table of ContentsMacromedia® Flash MX 2004 ActionScript: Training from the SourceBy
Derek Franklin, Jobe Makar Publisher: Peachpit PressPub Date: November 19, 2003ISBN: 0-321-21343-2Pages: 636
Sure, you can use Flash MX 2004 without being a master programmer, but as any Flash developer worth his or her salt will tell you, you''''re not tapping all of its power unless you''''re taking advantage of its scripting language "ActionScript 2.0" which offers a more robust programming model and better object-oriented programming support than ever before. Here to take the fear factor out of learning it are Flash veterans and best-selling authors Derek Franklin and Jobe Makar, who demonstrate that scripting is an instinctual process you already know by translating real-life activities into ActionScript scripts. In these pages, you''''ll find methodologies and techniques for building over 40 real-life Flash ActionScript projects, including sample games, applications, Web sites, and more. New in this edition are coverage of ActionScript 2.0, Web services, Components, Printing, Video, and more. On the companion CD, you''''ll find all the project files and images you need to complete each project.