Now that you know the relative points of each middleware technology and the differences among them, it's time to learn what happens behind the scenes when you integrate a middleware template with a Flash movie. The exact flow will differ slightly depending on which method you use. The available methods are as follows :
loadVariables() falls in the middle of the continuum of ease of use and flexibility. Passing URL variables is the easiest choice, but because it exposes all data in the HTTP request, it's not a good choice if anything should be kept secure, such as in a login routine. The XML object potentially exposes an unlimited number of uses because it provides a way to structure data into objects and pass the packets back and forth. However, the XML object can be challenging with which to work. getURL() and loadVariables() are very similar to one another. One of their main differences, however, is that getURL() either results in an additional browser window when it is used to call an exterior template or loads the external template in the same calling window. The latter destroys the Flash movie. loadVariables() is the best choice for sending a string of data from Flash into an external template behind the scenes because it enables the Flash movie to retain control of the calling window. The external template then is able to manipulate the data as variables. Integrating Middleware Templates with Flash MoviesFigures 28.6 “28.10 illustrate the sequence of a loadVariables() data transfer between a Flash movie and an external middleware (ColdFusion) template. Figure 28.6. End user requests an HTML file by clicking a hyperlink.
Figure 28.7. Server returns the file to the end user's browser. Browser processes client scripts, including the HTML <EMBED> tag. The <EMBED> tag sets up an HTTP request for a Flash file.
Figure 28.8. Server returns an SWF to the end user's browser. A Flash plug-in processes ActionScript. A loadVariables() action requests a ColdFusion template from the server.
Figure 28.9. The server locates the ColdFusion template and forwards it to the ColdFusion Application Server for processing.
Figure 28.10. The processed ColdFusion file returns directly to the SWF. The SWF file uses strings ColdFusion prints out as Flash variables.
|