Integrating Middleware with Flash


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 :

  • Using the loadVariables() action

  • Passing URL variables over the query string

  • Using the XML object

  • Using the getURL() action

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 Movies

Figures 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.

graphics/28fig06.gif

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.

graphics/28fig07.gif

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.

graphics/28fig08.gif

Figure 28.9. The server locates the ColdFusion template and forwards it to the ColdFusion Application Server for processing.

graphics/28fig09.gif

Figure 28.10. The processed ColdFusion file returns directly to the SWF. The SWF file uses strings ColdFusion prints out as Flash variables.

graphics/28fig10.gif



Inside Flash
Inside Flash MX (2nd Edition) (Inside (New Riders))
ISBN: 0735712549
EAN: 2147483647
Year: 2005
Pages: 257
Authors: Jody Keating

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net