Share this Page URL

Chapter 4. Flash and Generator > Summary - Pg. 79

Flash and Generator 79 · Generator Ad Any Banner.This uses JavaScript and VBScript to detect the Flash plug-in. It also embeds the SWT file. · Generator Image Output.This uses the IMG tag to display an image returned from a Gener- ator template. · Generator Only (default).This uses OBJECT and EMBED tags to display a Flash movie re- turned from a Generator template. · Generator QuickTime.This uses an EMBED tag to display a QuickTime movie returned from a Generator template. · If you don't need your file to be generated on demand, you can choose to publish the Flash Player (SWF) file to the server rather than to the Generator template-- in that you would want the embedded file to be an SWF file. Online versus Offline You'll hear a lot about online versus offline generation of Generator templates. So what's the dif- ference? When you are using Generator templates online, the server is creating a new file every time someone browses to the HTML page in which the template is embedded. If you have Generator 2 Enterprise Edition, you can set up caching features to save wear and tear on your server. However, if you are using Generator Developer Edition, a new file is created for every request of the template. The important distinction here is that the file did not exist prior to the request for it. Online generation is a Web server extension. It enables dynamic combinations of text, graphics, and sound into rich media. When a browser requests a Generator template from the Web server, the Web server passes the request to Generator by way of an instance of a Java servlet. Data is acquired from the data sources. The template and data are passed to the C++ code, which merges them and builds the image. If your data does not need to be updated in real time, you can run your templates offline to create Flash Player movies, GIFs, JPEGs, and so on and manually replace the files on the server only when there are changes to the data. Offline generation can be done in two different ways. Flash 5 includes a version of the Generator server. Every time you publish a Generator template from the Flash authoring environment, you are invoking an offline generation. Offline generation also can be done at the command-line level if you have the Generator server extensions installed. Instead of sending a file back to a browser, offline generation creates a physical file in the format requested and saves it to a hard drive. Summary Together, Generator and Flash are extraordinarily powerful. The predefined Generator objects can be used to quickly build movies in Flash that would be difficult or cumbersome to build otherwise. Bear in mind that you don't have to be running Generator server to take advantage of much of the power of Generator. If you need to be able to generate customized graphics on the fly, Generator Enterprise Edition is for you. If you're looking just for an easy way to build tickers, charts, scrolling lists, and so on, you can put the Generator templates to work for you. Remember that you're creating Flash movies (or GIFs, or JPEGs, or whatever you choose in the Publish Settings dialog box) every time you publish your template. You have the power--use it! In Chapter 28, you get the chance to see how you can use a Generator/Flash/middleware approach to connect a Generator template to a database in real time to produce dynamic, on-the-fly graphics and media.