macromedia - evl · 2002. 2. 6. · macromedia, made with macromedia logo and design, magic logo...

128
macromedia Using Generator macromedia ® GENERATOR 2

Upload: others

Post on 25-Mar-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

macromedia

Using Generator

macromedia®

GENERATOR™

2

Page 2: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

2

Trademarks

Add Life to the Web, Afterburner, Aftershock, Andromedia, Animation PowerPack, AppletAce, Aria, Attain, Attain Objects, Authorware, Authorware Star, Backstage, Design in Motion, Director, Doc Around the Clock, Dream Templates, Dreamweaver, Dreamweaver Attain, Drumbeat, Drumbeat 2000, Extreme 3D, Fireworks, Flash, Fontographer, FreeHand, Generator, Generator Dynamic Graphics Server, Know Your Site, Knowledge Objects, Knowledge Stream, Knowledge Track, LikeMinds, LikeMinds Reporter, Lingo, Live Effects, MacRecorder and Design, Macromedia, Macromedia Action, Macromedia CourseBuilder for Dreamweaver, Macromedia Flash, Macromedia M Logo & Design, Macromedia Xres Logo and Design, Macromind, Macromind Action, MacroModel, Made with Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring, Power Applets, Priority Access, Roundtrip HTML, Scriptlets, SoundEdit, Shockrave, Shockmachine, Shockwave, shockwave.com, Shockwave Remote, Shockwave Internet Studio, Titlemaker, Tools to Power Your Ideas, Universal Media, Virtuoso, Web Design 101, Whirlwind, and Xtra are trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words or phrases mentioned within this publication may be trademarks, servicemarks, or tradenames of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally.

This guide contains links to third-party Web sites that are not under the control of Macromedia, and Macromedia is not responsible for the content on any linked site. If you access a third-party Web site mentioned in this guide, then you do so at your own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third-party sites.

Apple Disclaimer

APPLE COMPUTER, INC. MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, REGARDING THE ENCLOSED COMPUTER SOFTWARE PACKAGE, ITS MERCHANTABILITY OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. THE EXCLUSION OF IMPLIED WARRANTIES IS NOT PERMITTED BY SOME STATES. THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. THIS WARRANTY PROVIDES YOU WITH SPECIFIC LEGAL RIGHTS. THERE MAY BE OTHER RIGHTS THAT YOU MAY HAVE WHICH VARY FROM STATE TO STATE.

Copyright © 2000 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced, translated, or converted to any electronic or machine-readable form in whole or in part without prior written approval of Macromedia, Inc. Part Number ZGD20M100

Acknowledgments

Writing: Marcelle TaylorEditing: Peter Fenczik and Rosana FrancescatoMultimedia Design and Production: John Lehnus and Noah ZilberbergPrint and Help Production: Chris BasmajianWeb Editing: Jane Dekoven and Jeff HarmonProject Management: Joe SchmitzSpecial Thanks: Coco Cook, Margais Dumas, Cheryl Harris, Jon Moter, Eric Mueller, Brian Payne, Mike Rouiller, Jim Ryan, and Mitsuko Yoneyama

Second Edition: July 2000

Macromedia, Inc.600 Townsend St.San Francisco, CA 94103

Page 3: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

CONTENTS

INTRODUCTION

Getting Started with Generator. . . . . . . . . . . . . . . . . . . 7

System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Installing Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Installing JRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Uninstalling Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12What’s new in Generator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Guide to instructional media. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

CHAPTER 1

Generator Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Creating Generator templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Using the Generator Objects palette and the Generator panel . . . . . . . 21Identifying symbols in the library . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Creating and using variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Making Generator objects targets of actions . . . . . . . . . . . . . . . . . . . . 27Using buttons in templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Integrating Generator with Web application server technologies . . . . . 30

3

Page 4: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Contents

4

CHAPTER 2

Creating Generator Objects. . . . . . . . . . . . . . . . . . . . . 31

Caching Generator objects (Enterprise Edition feature). . . . . . . . . . . . .31Inserting symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32Inserting a Flash movie file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33Inserting GIF, JPEG, and PNG files . . . . . . . . . . . . . . . . . . . . . . . . . . .34Inserting sounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36Creating lists and tickers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37Creating tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40Plotting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42Creating basic charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43Inserting pie charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48Inserting stock charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49Using the Radio Button object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52

CHAPTER 3

Dynamically Modifying Instances. . . . . . . . . . . . . . . .55

Replacing movie clips and graphic symbol instances . . . . . . . . . . . . . . .56Replicating a movie clip or graphic symbol . . . . . . . . . . . . . . . . . . . . . .57Setting transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60Setting brightness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61Setting tint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61Specifying a custom color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62Transforming movie clips and graphic symbols . . . . . . . . . . . . . . . . . . .65

CHAPTER 4

Using Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

Data source format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68Providing data sources to Generator . . . . . . . . . . . . . . . . . . . . . . . . . . .72Using JDBC/ODBC data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75Using URL (HTTP, FTP, or FILE) data sources . . . . . . . . . . . . . . . . . .77Using Java data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78Working with cross-platform and localized data sources . . . . . . . . . . . .82Processing several data sources in a template . . . . . . . . . . . . . . . . . . . . .83

Page 5: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

CHAPTER 5

Processing Templates with Generator . . . . . . . . . . .85

Using the Publish Settings command . . . . . . . . . . . . . . . . . . . . . . . . . .86Previewing, debugging, and exporting templates . . . . . . . . . . . . . . . . . .88Choosing online or offline processing . . . . . . . . . . . . . . . . . . . . . . . . . .90Using HTML syntax for Generator templates . . . . . . . . . . . . . . . . . . . .91Processing templates with the Online Generator . . . . . . . . . . . . . . . . . .93Processing templates with the Offline Generator . . . . . . . . . . . . . . . . .94Setting Offline Generator options . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95Placing Generator content on the server . . . . . . . . . . . . . . . . . . . . . . . .98

CHAPTER 6

Setting Administration and Caching Properties. . .99

Editing the generator.properties file. . . . . . . . . . . . . . . . . . . . . . . . . . .100Administration Servlet and caching feature (Enterprise Edition only) .100Using the Administration Servlet (Enterprise Edition only). . . . . . . . .101Generating a Transaction Report (Enterprise Edition only) . . . . . . . . .103Configuring the Servlet Properties panel . . . . . . . . . . . . . . . . . . . . . . .104Caching (Enterprise Edition only). . . . . . . . . . . . . . . . . . . . . . . . . . . .105Enabling and configuring Generator caching . . . . . . . . . . . . . . . . . . .108Caching examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112Generator properties table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115

APPENDIX A

Data Source Summary for Generator Objects. . . 119

INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

Contents 5

Page 6: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Contents

6

Page 7: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

INTRODUCTION

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Getting Started with Generator

Generator is the Web-server production application that can dynamically combine text, graphics, and sound to build rich media content and deliver the final product in a variety of animated or static formats.

Designers use the Generator authoring extensions (Generator Objects) to create templates that contain variable elements (graphics, text, and sound) to be replaced with content provided by a data source (text files, databases, and so on). This generated content can be played back in the client’s browser as Flash player movies, or as JPEG, PNG, GIF, animated GIF, or QuickTime files. (You can also deliver the content as a stand-alone application, called a projector.) Generator frees designers from the tedium of updating Flash movies each time they make a small change to the content. The authoring extensions used alone, create static SWF, GIF, JPEG, PNG, or MOV files that can be added to Web pages and uploaded to a Web server. When the online and offline server components of Generator are installed, the Generator authoring extensions can be used to create graphical front-ends for sophisticated server-side applications, such as interactive weather maps or site navigation.

The Flash 5 English CD installer provides the option of installing the Generator authoring extensions without the online and offline server components. The Flash 5 English CD also includes a trial version of the Generator Developer Edition (for the Windows version of Microsoft Internet Information Server and Personal Web Server) that can be installed after completing the Flash 5 installation process. Using Generator contains the information necessary to create Generator content using Flash 5, and instructions on installing and configuring a full version of Generator. It contains information that does not apply to users who are only using the authoring extensions installed with Flash 5. In particular, the installation and configuration information in this chapter, information about the online and offline server component in Chapter 5, and information about the Administration Servlet and generator.properties file in Chapter 6, are only for users running a complete installation of Generator.

7

Page 8: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

The following flowcharts demonstrate the process of using Generator in each of the possible modes of operation: authoring, online, and offline.

Authoring mode

Note: Static content created in authoring mode using Publish or Test > Movie can be uploaded to a Web server that does not have Generator installed.

Online mode

Offline mode

GeneratorFlash andGenerator

.swt

Copy toGen Server

(offline/online)Export

Generator

Web ServerWeb Browser

Cache

.swf

Data.swt

If cacheenabled

(Generator EnterpriseEdition only)

Data sources

Generator(offline).swt .swf

(Static fileon disk)

generator.exe

Introduction8

Page 9: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

System requirementsThe following hardware and software are required for authoring and previewing Generator templates:

• For Microsoft Windows™: Flash 5; an Intel Pentium® 200 or equivalent processor running Windows 95, 98, 2000, or NT version 4.0 with Service Pack 5 or later; 32 MB of RAM (64 MB recommended) plus 48 MB of available disk space; a color monitor; and a CD-ROM drive.

• For the Macintosh®: Flash 5; a Power Macintosh running Mac OS 8.5 or later; 48 MB of RAM (64 MB recommended) plus 20 MB of available disk space; a color monitor; a CD-ROM drive; and Mac OS Runtime for Java 2.1 (MRJ) or later. If necessary, you can download the MRJ from www.apple.com/java.

The following hardware and software are required for serving Generator content:

• For Microsoft Windows: NT 4.0 Server (Service Pack 5) with Internet Information Server 4.0 or iPlanet 4.0; Windows 2000 with Internet Information Server 5.0; or Windows 95, 98, or NT 4.0 Workstation with Personal Web Server 4.0, with a minimum of 64 MB RAM, 48 MB available disk space, and 64 MB of swap space.

• For Solaris® systems: a Sun Sparc System running Solaris 2.6 or 7 with Apache HTTP server 1.2.6 or 1.3.x or later, or Netscape Enterprise 3.5 or later, with a minimum of 64 MB RAM and 80 MB available disk space, and 128 MB of swap space.

• For Linux systems: Red Hat Linux 6.1 with Apache HTTP server 1.3.9 or later, with a minimum of 64 MB RAM and 80 MB of available disk space, and 128 MB of swap space.

Getting Started with Generator 9

Page 10: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Installing GeneratorBefore installing a new version of Generator, you must uninstall all previous versions of Generator (see “Uninstalling Generator” on page 12) and have a Generator-supported Web server installed and running on your system (if you want to use the online Generator).

Generator consists of the following components:

• Authoring extensions that enable the authoring and previewing of Generator templates in Flash.

Note: The Generator Authoring extensions without the Generator server components, are installed by default if you have the Flash 5 English CD. The Flash 5 English CD also includes a trial version of the Generator Developer Edition (for the Windows version of Microsoft IIS Web server). Generator online help is not included on the Flash 5 CD and must be downloaded from the Generator Support Center.

• Offline server components for creating Generator content without a Web server. Offline Generator runs from a command line.

• Online server components that enable real-time generation of Flash movies through your Web server. If you select the online components, and are on a Win 32 system running IIS, or on a Linux or Solaris system running Apache, the Generator installer will also install JRun, a Java servlet engine that allows you to pass information to and from the Web server using Java servlet protocol. If you are using Netscape iPlanet, Generator will not install JRun, as iPlanet has its own servlet engine.

• Online help.

On Windows, the installer offers four options for installing Generator components:

• Flash 5 Authoring Extensions installs the authoring extensions.

• Offline Components installs both the offline and the online components, but does not install JRun.

Note: You must have a Java servlet engine to generate Flash movies from a Web server. Although you may use any servlet engine that you choose, using a servlet engine other than the one installed with Generator is not recommended and is not supported by Generator technical support.

• Online Components with JRun Servlet Engine installs the online component and JRun. If you are using Netscape iPlanet, JRun is not installed, and the iPlanet servlet engine is used instead of JRun. The online server component requires Netscape iPlanet or JRun and a Web server supported by Generator. The Web server must be installed before installing Generator.

• Documentation/Help installs the Generator online help.

Introduction10

Page 11: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

On the Macintosh, the only installation options are Flash 5 Authoring Extensions and Documentation/Help.

On Solaris and Linux systems, the installer automatically installs both the online and offline components and the online help. After running the installer, configure Generator using the install notes in the Generator parent directory.

Using Generator

To author Generator templates, you use Flash. The easiest way to tell if the Generator Authoring Extensions were installed properly is to choose Window > Generator Objects and see whether the Generator Objects palette appears.

On Windows systems, the Offline Generator executable file (generate.exe) is installed in the Generator installation folder. You can run the Offline Generator either directly from the MS-DOS command line, or from a batch or scripting environment such as an MS-DOS batch file or Perl script.

On the Solaris and Linux systems, the Offline Generator is installed to the current directory (where the BIN file is executed) or a directory that you choose, <generatorparentdirectory>/generator/generate. You can run the Offline Generator from the command line in a shell or from a Perl script.

The Offline Generator has several options (command-line switches) that modify the default operation of the program. For more information on Offline Generator options and processing templates with the Offline Generator, see “Processing templates with the Offline Generator” on page 94 or type generator -help.

Installing JRunWhen installing the online version of Generator, the installer also installs Allaire JRun into a subfolder within the Macromedia folder. On Windows systems, the subfolder is Macromedia\Generator 2; on UNIX systems, the subdirectory is generator_2 (with no space preceding the numeral 2). Generator installs the jrun.dll file into your Web server’s scripts directory and overwrites any jrun.dll file that may already exist in that directory.

On UNIX systems, JRun is either compiled into the Apache Web server or specified as a module for the Netscape Enterprise server.

Note: JRun is not installed if you are running the Netscape iPlanet Web server.

Getting Started with Generator 11

Page 12: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Uninstalling GeneratorBefore installing Generator, you must uninstall all previously installed versions of Generator. Uninstalling Generator does not erase content (SWT files) that you have created with Generator. On Windows you must shut down the JRun Service Manager before uninstalling Generator.

To uninstall Generator from Windows, do the following:

1 Stop the JRun Service Manager doing one of the following:

• On Windows 95 and 98, click the JRun Service Manager icon (which looks like a gear) in the System Tray on the Taskbar. The Application Control dialog box appears.

• On Windows NT you can shut down the JRun Service Manager using the Services control panel.

2 Click the Stop button.

3 Use Add/Remove programs to uninstall Generator.

To uninstall Generator from Solaris and Linux, do the following:

1 Stop Generator using the stop_generator script.

2 Manually remove Generator configuration changes from the Web server files.

3 Delete the Generator parent directory tree.

Introduction12

Page 13: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

What’s new in Generator The Generator Authoring Extensions are installed by default if you have the English version of the Flash 5 CD. You can use the Authoring Extensions to automate production tasks in Flash, and publish static SWF, GIF, JPEG, PNG, or MOV files that can be added to Web pages and uploaded to any Web server. If you use the Authoring Extensions to create dynamic content that is assembled using data provided when the content is served to the viewer, you need to publish a SWT file and have Generator installed on your Web server.

Generator is available in two editions, the Enterprise Edition and the Developer Edition. A trial version of the Developer Edition (for the Windows version of Microsoft IIS Web server) is included on the English version of the Flash 5 CD. Both editions benefit from performance enhancements made to the Generator program, and are fully functional in a production environment. All of the features in the following list are available in both editions except where noted.

New and improved Generator Object palette

The Generator object palette has a new look and improved functionality including a scroll bar allowing easy access to all Generator objects, and a pop-up menu that allows developers to organize and display custom objects that they have created. The menu items listed in the pop-up menu correspond to folders created in the Flash5/generator/templates folder. When a pop-up menu item is selected, the objects that have been placed in the created folder are displayed.

Support for Flash 5

Generator supports all of the new features available in Flash 5 including the new Flash 5 ActionScript and the Movie Explorer.

Three new Generator objects

Generator includes the following new objects:

• Multipage List creates a set of pages to display large lists of information that users can navigate using Next, Previous, and Home buttons.

• Radio Button creates a set of radio buttons that can be linked to any of the targets that can be specified for a regular Flash Generator button.

• Insert MP3 expands Generator’s sound processing capabilities by allowing users to insert MP3 files in addition to sound symbols in the Flash library.

Getting Started with Generator 13

Page 14: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Generator SDK and API

The Generator API has been exposed and documented to allow Java developers to create their own custom Generator objects that appear in the Generator Objects palette and in the Generator panel. Extending Generator, the documentation for using the Generator API, is in the api_docs folder at the root of the Generator installation folder. There is also an api_docs folder on the installation CD that contains both HTML and PDF files of Extending Generator.

Generator Administration Servlet (Enterprise Edition only)

The Administration Servlet provides a browser-based user interface for viewing Generator information and modifying the Generator configuration. Because the Administration Servlet user interface is browser based, you have the option of administering Generator and the caching feature from a local or remote machine. Review the instructions in “Using the Administration Servlet (Enterprise Edition only)” on page 101 before launching the Administration Servlet. To launch the Administration Servlet, start your Web server and enter http://localhost or Web server name/servlet/GenAdmin.

Use the Information, Server, and Statistics panels in the Administration Servlet to view your Generator serial number, the time Generator was launched, the port number being used by the Web server, the number of threads concurrently being processed, and statistics relating to the number of requests and processing time for each file type supported by Generator.

Use the Properties panel to view and set the information recorded in the generator.properties file, including log level, thread processing, the location of the external font and default symbol files, the user class path for Java, the amount of time allowed for request processing, and online memory handling.

Note: Developer Edition users can administer Generator by editing the generator.properties file located at the root of the Generator installation folder. See “Setting Administration and Caching Properties” on page 99 for complete instructions and information.

Generator caching (Enterprise Edition only)

The Generator caching feature allows content to be processed, saved in a disk or memory cache, and then served repeatedly, without having to be fetched or processed again. The Generator caching feature includes Request, Font, Media, and File caches, which can be enabled and configured globally or separately, using the Administration Servlet. Generator caching can reduce the load on your Web server, improve server performance under load conditions, reduce response time, and allow you to configure automatic updates of content. Use the Cache Settings panel in the Administration Servlet to enable, configure, and manage caching for your system.

Introduction14

Page 15: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Special note to Generator Developer Edition users

You can change the default configuration settings used by Generator by editing the generator.properties file located in the properties folder at the root of the Generator installation folder. Use the information in “Editing the generator.properties file” on page 100 and in “Configuring the Servlet Properties panel” on page 104, to edit the generator.properties file for your system. Please note that the setting for Max Threads is set to 1 and cannot be changed by editing the properties file. Also, you cannot add properties to the properties file that are specified for the Enterprise Edition. Adding invalid entries to the generator.properties file may disrupt Generator processing.

Upgrade information

Generator 1.x templates are fully functional with both the Enterprise Edition and the Developer Edition, except that the parameters specified in the Settings dialog box are not preserved. Generator 2.0 templates are fully compatible with both the Enterprise Edition and Developer Edition.

Generator 2.0, Generator Enterprise Edition, and Developer Edition cannot be installed with Flash 3; Flash 4 and 5 cannot be installed with Generator 1.0.

You cannot run more than one version of Generator on the same computer at the same time. It is recommended that you uninstall all previous versions of Generator and JRun before installing a new version of Generator.

Getting Started with Generator 15

Page 16: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Guide to instructional mediaAll Generator instructional media assumes that you know how to use Flash 5. The Generator SDK/API documentation, Extending Generator, and examples in the extras folder are intended for experienced Java programmers. The instructional media set for the Generator Enterprise and Developer Editions includes a printed book, the three separate online HTML help systems covered below, a PDF file of the Generator SDK/API documentation, and a regularly updated Web site.

Using Generator

Using Generator contains instructions and information for using all Generator tools and commands. It is provided as both online help and a printed book. The Administration Servlet chapter is not included in the online help launched from within the Flash program. Online help for the Administration Servlet (Enterprise Edition only) is launched by clicking the Help icon (which looks like a question mark) on any panel of the Administration Servlet. The online help launched from within the Flash program contains a variety of Flash Player movies demonstrating effects and features.

Extending Generator

Extending Generator consists of two parts: Chapter 1, “Extending Generator Overview” and Chapter 2, “Generator API.” Chapter 1 contains instructions for building Generator objects using the classes and methods described in “Generator API.” Chapter 2 contains information about the classes in the Generator API, and specific information for using the methods in the API to create Generator objects. “Extending Generator Overview” references a set of example files that can be found in the extras folder at the root level of the Generator installation folder. If you have Adobe Acrobat Reader you can open the PDF file of Extending Generator on the CD.

Introduction16

Page 17: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using Generator online help systems

For the best experience when using any of the Generator online help systems, Macromedia strongly recommends that you use Netscape Navigator 4.0 or later or Microsoft Internet Explorer 4.0 or later on Windows, and Netscape Navigator 4.0 or later on the Macintosh. If you use a 3.0 browser, the content of the movies and the Flash help is accessible, but some features (such as Search) do not work.

To use Generator online help, choose one of the following:

• To open Using Generator, choose Help > Flash Help Topics and click the Generator Help link in the table of contents.

• For online help pertaining to any panel in the Administration Servlet (Enterprise Edition only), click the Help icon (which looks like a question mark) in the upper right corner of that panel. The online help for the Administration Servlet is unique for each panel, is not searchable, and does not have an index.

• To open Extending Generator, open the api_docs folder at the root of the Generator installation folder or on the Generator CD, and launch the HTML help by clicking ContextHelp.html.

Navigate the help topics using any of these features:

• Contents organizes information by subject. Click top-level entries to view subtopics.

• Index organizes information in the same way as a traditional printed index. Click a term to jump to a related topic.

• Search finds any character string in all topic text. Search requires a 4.0 or later browser with Java enabled. To search for a phrase, simply type the phrase into the text entry box. To search for files that contain two keywords, separate the words with a plus (+) sign.

• Previous and Next buttons let you move through the topics within a section.

• The Generator icon links you to the Generator Support Center Web site.

Generator Support Center

The Generator Support Center section of the Macromedia Web site (www.macromedia.com/support/generator) is updated regularly with the latest information on Generator. Use the Support Center as a great source for the most recent technical support information (TechNotes), advice from expert users, advanced topics, examples, tips, and updates.

Getting Started with Generator 17

Page 18: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Introduction18

Page 19: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

1

CHAPTER 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Generator Basics

A Generator template has placeholders for text, graphics, and sound. Generator can dynamically fill the placeholders with content from a data source to create a Flash Player movie or a GIF, animated GIF, JPEG, or PNG file. The data can be sport scores, stock quotes, news headlines, images, values for charts, and so on. The data source can be a text file, text output returned by an HTTP or FTP request, a result set from a Structured Query Language (SQL) query, or a user-created Java class.

Generator can process a template in three ways: authoring, online, or offline processing. In authoring mode, Generator creates static output for the file types selected in the Publish Settings dialog box whenever you use the Publish or Test > Movie commands. Online processing is done as an extension to your Web server and occurs when a client browser requests the template file. Offline processing is done with a command-line version of Generator.

Online processing is best suited for Web sites where graphics need to be customized for each visitor to the Web site. Offline processing is best suited for Web sites where the data source changes infrequently.

19

Page 20: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Creating Generator templatesYou create Generator templates using the Generator Objects in Flash. Creating and deploying Generator templates consists of these general steps:

1 Create Generator objects. Generator objects include charts, tables, lists, graphs, radio buttons and placeholders for Flash Player movies, symbol instances, and image files. You can also apply Generator symbol commands to symbol instances. A Generator template can contain more than one Generator object. See “Using the Generator Objects palette and the Generator panel” on page 21.

2 Specify variables if you are using them in the template. Variables let you insert text into a Generator template when content is created. You can also use variables as parameters for Generator object properties, as parameters for most button and frame actions, or as frame labels. See “Creating and using variables” on page 23.

3 Create data sources and assign them to main timelines or to specific objects. A data source can define text or graphics that are inserted in the template, or it can contain values for generating objects such as a chart or a scrolling list. See “Providing data sources to Generator” on page 72.

4 Choose Generator output using the Publish Settings dialog box. In addition to Flash Player movies, you can create JPEG, PNG, QuickTime 4, or GIF files using Generator templates. See Chapter 5, “Processing Templates with Generator.”

5 Choose Generator output using the Publish Settings dialog box. In addition to Flash Player movies, you can create JPEG, PNG, QuickTime 4, or GIF files using Generator templates. See Chapter 5, “Processing Templates with Generator.”

6 View and debug the template. You can display a debugging report when you preview a Generator template to check for errors and determine where you might need to make corrections to the template. See “Previewing, debugging, and exporting templates” on page 88.

7 Deploy the template file for processing. After creating a Generator template with Flash, you copy it to a Web server along with any associated data sources and external media content. See Chapter 5, “Processing Templates with Generator.”

Note: The Generator server component must be installed on the Web server in order to deploy SWT files.

Chapter 120

Page 21: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using the Generator Objects palette and the Generator panelUse the Generator Objects palette to place Generator objects on the Stage and in symbols. In Flash, Generator objects appear as gray squares on the Stage. The object type appears in the left corner for identification.

Use the Generator panel to set properties for the selected Generator object. The properties determine how the object appears in the generated output. You can also use the Generator panel to apply a Generator command to a symbol instance. For details about object panel properties, see Chapter 2, “Creating Generator Objects,” and Chapter 3, “Dynamically Modifying Instances.”

To show or hide the Generator Objects palette:

Choose Window > Generator Objects. In Windows, you can also hide the palette by right-clicking the palette and choosing Hide.

Note: If this command is disabled, Generator has not been installed successfully.

Drag the Generator object to the Stage or into a symbol

Specify object properties

The menu items correspond to folders in Flash5/generator/templates

Generator Basics 21

Page 22: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

To place a Generator object on the Stage or in a symbol:

1 Display the Generator Objects palette.

2 Drag the object from the Generator Objects palette to the Stage, or double-click the object in the palette. The Generator panel will appear when you create a Generator object.

To display the Generator panel:

Do one of the following:

• Double-click a Generator object on the Stage.

• Right-click a Generator object or instance on the Stage, and choose Generator panel.

• Choose Window > Panels > Generator and select the Generator object or instance.

To show or hide descriptions in the palette or panel (Windows only):

Right-click the Object palette or Generator panel and choose Description. Hiding descriptions in the Generator Objects palette displays icons only. Hiding descriptions in the panel removes the property descriptions that appear at the bottom of the panel.

Identifying symbols in the libraryWhen specifying a symbol from the library for use with a Generator object or command, refer to the symbol by the name assigned to it in the library. If the symbol is contained within a folder in the library, refer to it by folder name/symbol name. For example:

If a symbol named red_ball is not contained within a folder in the library, refer to it as simply red_ball.

If a symbol named red_ball is within a folder named Red_Objects, refer to the symbol as Red_Objects/red_ball.

If a symbol named red_ball is stored within the Balls subfolder inside the Red_Objects folder, refer to the symbol starting with its parent folder and on through to its name: Red_Objects/Balls/red_ball.

See Chapter 5, “Processing Templates with Generator” for information about specifying symbols in external media.

Note: You may need to resize the Generator panel in order to view all of the parameters in the list, or to view the help strings at the bottom of the panel.

Chapter 122

Page 23: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Creating and using variablesVariables are placeholders for values that you can assign later, when the Generator template is processed. You supply the values for the variables in data sources that you create.

Variables can hold positions where you later insert any string literal. This includes not just visible text but also text that has some function, such as with actions like goTo Label, or text that specifies the name of symbol to insert, or even text that provides a value of True or False to the Replace command’s Replace Symbol property (effectively enabling or disabling the command).

You can define variables in the following places:

• As text blocks on the Stage

• As parameters to Generator objects

• As parameters and arguments to Flash actions

• As a frame label for use with actions in the main Timeline and in child timelines

• As an instance name in the Name field of the Instance panel

When using Generator variables with Flash 5 ActionScript, be aware that ActionScript treats Generator variables as strings. Generator variables must be enclosed in double quotes (“{GeneratorVariable}”). For actions and functions that accept string values for arguments, double quotes are supplied by Flash if the Expression check box is not selected. If the Expression check box is selected, you need to enter the double quotes around the Generator variable. For actions and functions that do not accept strings as arguments, you may be able to use one of the ActionScript functions to convert the string value inserted by Generator to the required type.

Generator Basics 23

Page 24: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Defining variables

To define a variable, use the following syntax:

{GeneratorVariableName}

The curly braces ({}) are required; they indicate a variable definition. Specify the name of the variable between the curly braces; the name can consist of any alphanumeric characters. Variable names are not case-sensitive.

As good development practice, try to give variables meaningful names that are unique within the template; this avoids confusion over ambiguous variable names. For example, {name} defines a variable called name, {address} creates a variable named address, and {greeting} defines a variable called greeting.

You can concatenate variables. For example, you can specify the following to display the full name:

{firstname} {lastname}

See also Chapter 4, “Using Data Sources.”

You can define the value for a variable using the parameters fields in the Generator tab of the Publish Settings dialog box, using command-line parameters for offline processing, as URL parameters for online processing, or by placing them in an external data source. See Chapter 5, “Processing Templates with Generator.”

If you specify a variable but do not define its value in a data source, it is usually left blank when Generator processes the template. If you’ve specified an undefined variable for an action, its declaration remains unchanged.

Chapter 124

Page 25: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using variables to dynamically replace text

You can use variables to dynamically replace text. If the parameter field requires specific values or accepts a limited range of values, be careful to supply a valid value for the variable in your data source.

The variable as it appears on the Stage

To create variable text for dynamic replacement:

Use the Text tool to create a text box in the movie. Type the variable name, enclosing it within braces, such as {variableName}. The variable name cannot contain spaces or any other nonalphanumeric characters.

Using variables as parameters to Generator objects and commands

You can specify variables for any Generator object or command where you can enter text. Simply type the variable in the parameter field.

Generator Basics 25

Page 26: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using variables as parameters for Flash actions

You can dynamically modify an action by specifying variables as parameters for any action field where you can enter text.

To use variables for action parameters:

1 Select the button or movie clip on the Stage, or keyframe in the Timeline. Select Window > Actions.

2 Double-click an action in the Toolbox list.

3 Specify a variable in one of the action parameter fields using the {variableName} syntax. Be sure to enclose the variable in double quotes if you are specifying an expression for the parameter value.

Note: Some actions cannot be previewed with Flash; you need to preview them in a browser.

The following example shows how an action specified with a variable expression is replaced when Generator processes it.

The data source, data.txt, contains the following:

name, valueservervar, testlabel, label1

Before the action is processed by Generator, it looks like this:

on (release) {clientvar = "{servervar}";if (clientvar == "test"){

trace ("servervar: {servervar}");trace ("label: {label}");gotoAndStop ("{label}");

}}

After the action is processed by Generator using the data.txt data source, it looks like this:

on (release) {clientvar = "test";if (“test” == "test") {

trace ("servervar: test");trace ("label: label1");gotoAndStop ("label1");

}}

When the button is pressed, the play head goes to label1 and stops.

Chapter 126

Page 27: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Making Generator objects targets of actionsYou can make a Generator object the target of actions by using the Instance Name parameter and specifying an action that references it.

The following example shows how to make a Generator object the target of actions. You create a button that stops a movie when it is selected.

To use the Insert Symbol command’s Instance Name parameter for actions:

1 Double-click Insert Symbol in the Generator Objects palette.

2 In the Generator panel, specify any symbol in the library for the Symbol parameter.

3 Type hello for the Instance Name parameter.

4 Create a button with the following actions:

on (release){hello.stop();}

Notice how the new Flash 5 action script syntax allows you to apply Flash actions that are methods of the MovieClip class directly to the target, without using the tellTarget action.

5 Preview the movie with Generator enabled in the Publish Settings dialog box.

In the preview movie, if you click the button you created, the stop action is applied to the target, hello.

The following example shows how to use a movie clip symbol that is contained in a Generator object as the target of actions.

Generator Basics 27

Page 28: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

To use a movie clip inside of a Generator object for actions:

1 Double-click Plot in the Generator Objects palette.

2 In the Generator panel, specify obj for the Instance Name parameter.

3 In the data source of the Plot command, use the column names Clip, x, y, and instancename. For the Clip column, specify a movie clip symbol name. Specify any x and y values you want. For the instancename column, specify target1. (You can give any name to make this symbol a target of actions.)

4 Create a button with the following actions:

Attach a stop method to the instance inside of the Generator object. Make sure you use a period to specify the path hierarchy. Using the stop method in the MovieClip class, the button actions should look like the following:

on (release){obj.target1.stop();

}

5 Preview the movie with Generator enabled in the Publish Settings dialog box.

In the preview movie, if you click the button you created, the action is applied to the target, target1.

Chapter 128

Page 29: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using buttons in templatesYou can place buttons on the Stage in a Generator template. Actions assigned to the button can include Generator variables. You cannot, however, place Generator objects inside any button state, nor can you use any template command, such as Replace or Insert Symbol, to directly place a button in the generated movie.

If you want to nest a Generator object inside a button, first place the object inside a movie clip, and then place an instance of that movie clip inside the button by dragging it from the library to the Symbol Editing window.

If you want to use a Generator object to place a button on the Stage in a generated movie, you must create a new movie clip and place an instance of the button inside it by dragging the button from the library into the Symbol Editing window. You can then use the Generator object to place the movie clip in the generated movie. The button functions as designed.

You can place radio buttons in Generator templates using the Radio Button object. See “Using the Radio Button object” on page 52 for more information.

Guidelines for working with buttons and actions

Remember the following guidelines when working with button and actions:

• Don’t use Generator objects or commands to place buttons from the library into the movie. When buttons are needed within a template, drag them from the library to the Stage or Symbol Editing window.

• Don’t assign data sources to button Timelines by using the Generator Environment Variable button. See “Providing data sources to Generator” on page 72.

• Don’t put Generator objects directly within button states. They are not parsed and will not yield expected results. Instead, place instances of movie clips or graphic symbols that contain Generator objects or commands in the individual states of the button. These symbols are processed in an additional step and will work as expected.

• When declaring a variable for a target frame, use the goTo action with a frame label instead of a scene name or frame number. Scene names are not preserved when the Flash movie file (FLA) is exported to a Generator template (SWT), so they cannot be used to specify a target frame at run time. Frame numbers can be used, but users should be aware that Flash does not preserve scene Timelines when exporting SWT or SWF file formats. During the export process, Flash appends all of the scenes in sequential order to the end of the first scene in the main Timeline. If scene 1 has 15 frames and scene 2 has 5 frames, on export Flash creates a single 20 frame Timeline, and the first frame in scene 2 becomes frame number 16. If you target this frame using its original frame number (2), the action will not work.

Generator Basics 29

Page 30: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Integrating Generator with Web application server technologiesYou can integrate Generator with server technologies such as Allaire ColdFusion or Microsoft Active Server Pages. Find the most current information on this topic at the Generator Support Center on the Macromedia Web site (www.macromedia.com/support/generator).

Chapter 130

Page 31: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

2

CHAPTER 2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Creating Generator Objects

Generator objects are placeholders for Generator-processed content. Generator objects let you create special graphics, such as charts, tables, and lists, that would be tedious to create with standard Flash authoring techniques. When you create objects, you can specify the values for their parameters in data sources. See Chapter 4, “Using Data Sources” for more information.

Caching Generator objects (Enterprise Edition feature)You can cache individual files (SWF, GIF, JPEG, PNG, or MOV) used to create individual Generator objects, or the entire output of a Generator template file (SWT). Depending on how you enable and configure the Generator caching features, you have the option of selecting specific external media files for caching, caching all media and external font files (FFT), or caching the output of a Generator template (SWT) automatically. External media files (SWF, GIF, JPEG, PNG, or MOV) may be cached by setting their Cache property to True in the Generator panel. If you are retrieving these files via HTTP, you can specify caching options by appending cache parameters to the string portion of their URL. However, both the Cache property in the Generator panel and cache parameters specified in the URL may be overridden by cache settings in the Administration Servlet.

Complete instructions for enabling and configuring the Generator caching feature and for setting caching using URL parameters are provided in “Setting Administration and Caching Properties” on page 99. For objects that insert files, information about setting the Cache property in the Generator panel is included with their other panel properties.

31

Page 32: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Inserting symbolsUsing the Insert Symbol command, you can insert different Flash library items into a Flash movie when the template is processed. You can insert symbols from the template’s library or from an imported library at run time. (Use the External Media setting in the Generator Publishing Settings tab to import libraries. See Chapter 5, “Processing Templates with Generator.”)

When authoring movies for Flash 2 export that use the Insert Symbol command, make sure that the main timeline and any clips that are being inserted have the same number of frames.

After you insert the symbol, you can use the Flash Scale and Rotate tools to modify the size or rotation of the placeholder. The center point (cross hair) of the inserted symbol is registered using the center point of the placeholder, so position the Insert Symbol object using its center point as a reference.

Note: The center point of the inserted symbol becomes important when the Scale to Fit property is set to False and the inserted symbol potentially occupies a larger portion of the movie area.

Symbols have the following properties in the Generator panel:

Symbol Name specifies the symbol to insert. If symbols are in folders, use a fully qualified name (for example, /folder/folder/symbol name). See “Identifying symbols in the library” on page 22 for more information.

Scale to Fit scales the image to fit the boundaries of the gray box on the Stage.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this parameter.

Chapter 232

Page 33: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Inserting a Flash movie fileYou can dynamically insert other Flash movie (SWF) files into a template. When inserting a Flash movie file, you have the option of scaling the movie so that it fits into a defined space or leaving the movie at its original size.

Movie files have the following properties in the Generator panel:

File Name specifies the file name, relative or absolute URL (HTTP and FTP), database connection URL, or Java class URL from which Generator will obtain the movie data.

Cache specifies whether a file is cached (True), or not (False). Setting this parameter to True activates caching for this object if caching is turned on, and if the URL parameter for the file is not set to False (gmc=false).The Cache property setting in the Generator panel is overridden by the cache settings in the Administration Servlet and by any cache parameters specified in the URL for the file. For example, if Force Cache is set to True, or if the URL for the file specifies gmc=true, the file will be cached even if the parameter is set to False. For complete information about the Generator Caching feature, see “Setting Administration and Caching Properties” on page 99..

Scale to Fit scales the movie file to fit the boundaries shown in the display area.

Expand Frames expands the timeline containing the movie file so that all of the inserted movie can play. In most cases, set this property to True.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Creating Generator Objects 33

Page 34: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Inserting GIF, JPEG, and PNG filesYou can insert GIF (both static and animated), JPEG, and PNG files into a template. When inserting image files, you have the option of scaling the image so that it fits into a defined space or leaving the image at its original size.

You should be careful when using these Generator objects with the Online Generator. Animated GIF and JPEG files can be very large when decompressed and can significantly slow the performance of the Online Generator when an image must be recompressed. Use this template command only when you must insert a bitmap image from an external file and cannot use other solutions such as inserting a symbol or Flash movie.

All Generator objects that insert files (SWF, GIF, JPEG, PNG, and MP3) have a Cache property in the Generator panel that can be set to True or False. The Cache property setting in the Generator panel is overridden by the cache settings in the Administration Servlet and by any cache parameters specified in the URL for a file or template. Setting this property to True will activate caching for the object if it is served from a Web server that has the Enterprise Edition of Generator installed and you have set up caching using the instructions in “Setting Administration and Caching Properties” on page 99. If the files are served from a Web server that does not have the Enterprise Edition of Generator installed, this property is ignored.

Also, be aware that performance slows when you select a single frame other than frame 1 from an animated GIF file.

Insert GIF, JPEG, and PNG objects have the following properties in the Generator panel:

File Name specifies the file name, relative or absolute URL (HTTP and FTP), database connection URL, or Java class URL from which Generator will obtain the image data.

Scale to Fit determines whether or not the image is scaled to fit the object box or positioned at its original size.

Export As compresses the image (JPEG) or preserves as much image detail as possible (Lossless).

JPEG Quality specifies the compression level if you set Export As to JPEG. Values can be from 0 to 100. A value under 50 results in a very compressed image that has low quality but a smaller file size. A value over 80 results in an image that is less compressed and preserves more detail but has a larger file size. A value of 100 allows inserted JPEG files to pass through without first decompressing and then recompressing the image data, which significantly improves the performance of the Insert JPEG object.

Chapter 234

Page 35: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Cache specifies whether a file is cached (True), or not (False). Setting this parameter to True activates caching for this object if caching is turned on, if the URL parameter for the file is not set to False (gmc=false), and the file is served from a Web server that has the Enterprise Edition of Generator installed. The Cache property setting in the Generator panel is overridden by the cache settings in the Administration Servlet and by any cache parameters specified in the URL for a file or template. For example, if Force Cache is set to True, or if the URL for the file specifies gmc=true, the file will be cached even if the parameter is set to False. For complete information about the Generator Caching feature, see “Setting Administration and Caching Properties” on page 99.

Frames (GIF only) specifies the frames to retrieve from an animated GIF file. You can specify All, Single, or an integer representing the frame number to retrieve. Single retrieves the first frame of the animated GIF.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Creating Generator Objects 35

Page 36: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Inserting soundsYou can add sound to Generator templates using the Insert Sound and Insert MP3 Generator objects. When you insert a sound, Generator displays a placeholder even though the sound is not visible. You can insert sounds using symbols in the Flash library, or you can insert sounds contained in MP3 files stored on your hard drive. Sounds that are not in the MP3 file format must be imported into Flash before they can be inserted by Generator. Once in Flash, the sound can be in the current library or in an external library obtained through external media.

If you have the Enterprise Edition of Generator, and have enabled and configured the Generator caching feature using the instructions in “Caching (Enterprise Edition only)” on page 105, you can specify caching for MP3 files using the Cache property in the Generator panel. Sound symbols cannot be cached.

The Insert Sound object has the following properties in the Generator panel:

Sound Symbol specifies the name of the sound symbol in the Flash library. Use a fully qualified name (for example, /folder/folder/symbol name) if sounds are in folders. See “Identifying symbols in the library” on page 22 for more information.

Loop Count sets the number of times the sound plays.

The Insert MP3 object has the following properties in the Generator panel:

File Name is the name of the MP3 file to be inserted into the Flash movie. You can type the file name directly in the field or use the Browse feature to locate the file.

Cache specifies whether a file is cached (True), or not (False). Setting this parameter to True activates caching for this object if caching is turned on, if the URL parameter for the file is not set to False (gmc=false), and the file is served from a Web server that has the Enterprise Edition of Generator installed. The Cache property setting in the Generator panel is overridden by the cache settings in the Administration Servlet and by any cache parameters specified in the URL for a file or template. For example, if Force Cache is set to True, or if the URL for the file specifies gmc=true, the file will be cached even if the parameter is set to False. See “Setting Administration and Caching Properties” on page 99.

Stream determines whether the MP3 file is streamed to the Flash player (True) or sent to the player as a whole file before beginning to play. For maximum performance, Stream is set to True by default.

Delay specifies the frame time in samples before sound begins to play. Samples is the number of frames as determined by the frame rate setting you have chosen.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Chapter 236

Page 37: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Creating lists and tickersGenerator provides several objects for formatting and displaying lists of data located in an external data source. The following section covers lists, horizontal or vertical scrolling lists, and tickers. Multipage Lists are discussed in a further section. Database queries are especially useful with list objects, because they can easily accommodate the creation of a variable number of symbols in list form.

Lists, scrolling lists, and tickers

Lists, horizontal or vertical scrolling lists, and tickers share the same property settings in the Generator panel and are discussed as a group below.

List creates a nonscrolling list.

Scrolling List creates a list of items that can be scrolled. To scroll the list, you must specify an instance name and provide buttons for scrolling. The scrolling list is created inside a movie clip with enough frames to scroll to the end of the list.

In this example, Generator refreshes the scrolling list with the latest travel conditions.

Ticker creates a scrolling list that scrolls in a continuous loop. The ticker is created inside a movie clip with enough frames to show a complete cycle of the ticker.

Lists, scrolling lists, and tickers have the following properties in the Generator panel:

Data Source specifies the data source for the list. The only required column for a list is Clip. Use it to name the symbol that you want to insert in the list. The list will contain as many items as rows in the data source. You can specify a single symbol multiple times or use a variety of symbols.

Orientation specifies whether the list is laid out horizontally or vertically.

Mask to Box masks the contents of the list that fall outside the object’s bounding box when this option is set to True.

Creating Generator Objects 37

Page 38: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Step Size specifies the number of pixels that the list should scroll in a single frame. The motion will appear smoothest to the human eye at 1 pixel per frame. This property is for scrolling lists and tickers only.

Spacing is either Fixed or Auto. Fixed creates a list in which each item will take the amount of space specified in the Item Space option. Auto creates a list in which each item will use just as much space as it needs. The width or height of each item is added to the Item Space option.

Item Space specifies the number of pixels between items in the list if Spacing is set to Fixed.

Horizontal and Vertical Alignment specifies how the list elements should be aligned. Items are aligned by the center point of the symbols that define them. Design the symbols based on the alignment to be used. For example, when you use left top alignment, the center point should be at the left top of the symbol. When you use center bottom alignment, the center point should be at the center bottom of the symbol.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Multipage lists

The Multipage List object creates a series of pages to display large lists of data in smaller, more manageable chunks that users navigate using the Next, Previous, and Home buttons included with the object. If you do not want to use the buttons that are included with the Multipage List object, you may substitute any symbol that has been imported into the current library.

Multipage lists have the following properties in the Generator panel:

Chapter 238

Page 39: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Data Source specifies the data source for the list. The data source must contain a Text column and can optionally have Symbol, URL, and Window columns. Additional columns must correspond to variables specified in the Text symbol, or in a symbol listed in the Symbol column of the data source. The URL column lists a URL to load when the list element is clicked, and the Window column specifies the window in which to load the URL. Acceptable values for the Window column are _self (default), _blank, _top, or _window. See “Specifying a Window column for a URL in the data source” on page 70.

Items per Page specifies the maximum number of list elements to display on a page. Any value greater than 0 is acceptable, and the default value is 10.

Previous Symbol is the name of the symbol used for the button to go to the preceding page in the list. The default setting is blank, in which case Generator creates a symbol for this purpose. If a symbol file is specified, Generator first looks for the symbol in the file specified for the External Symbol file property. If it is not there, Generator searches the current template (SWT) file.

Home Symbol is the name of the symbol used for the button to go to the first page in the list. The default setting is blank, in which case Generator creates a default symbol for this purpose. If a symbol file is specified, Generator first looks for the symbol in the file specified for the External Symbol File property. If it is not there, Generator searches the current template (SWT) file.

Next Symbol is the name of the symbol used for the button to go to the next page in the list. The default setting is blank, in which case Generator creates a symbol for this purpose. If a symbol file is specified, Generator first looks for the symbol in the file specified for the External Symbol File property. If it is not there, Generator searches the current template (SWT) file.

Text Symbol is the name of the symbol containing the variable {text} that defines the text parameters (font, size, bold, italic, color, etc.) for the text in the list. If a symbol file is specified, Generator first looks for the symbol in the file specified for the External Symbol File property. If it is not there, Generator searches the current template (SWT) file.

Symbol Spacing specifies the amount of space between the symbol that controls the formatting of the list element or graphic file and the text as controlled by the Text symbol, in units equal to 1/20 of a pixel. In order to maintain uniform columns when the symbols in the data source vary in size, the symbol spacing parameter determines the amount of space between the two largest symbols, with smaller symbols having additional space. Valid values include all integers, and the default setting is 50.

Line Spacing specifies the amount of space between list items (not lines of text). Each unit represents 1/20 of a pixel. Valid values include all integers, and the default setting is 50.

Creating Generator Objects 39

Page 40: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

External Symbol File sets the path to an external Generator template (SWT) file containing the symbols to use for Next, Previous, Home, and Text symbols, and any other symbol referenced in the data source. When processing the template, Generator first searches the External Symbol File (if specified) for any symbols referenced in the data source. If the symbols are not found, Generator uses the symbols specified in the current SWT file or uses the default symbols for those parameters.

Instance Name identifies the instance of the object so that it can be used along with special variables that reside inside of the Multipage List template. These variables can be used in conjunction with the instance name, to retrieve information about a specific instance of the Multipage List template. The following are the variables defined for Multipage lists:

• numPages: the number of pages in the list

• numItems: the total number of list items in the list

• currentPage: the (1 based) page number currently displayed

For more information on using object specific variables, see “Using the Selected Button Variable property” on page 53.

Creating tablesYou can create a table of Flash symbols with data from a data source; it appears as a grid of cells, like a spreadsheet. The table can have column and row labels.

Chapter 240

Page 41: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Tables have the following properties in the Generator panel:

Data Source specifies the data source to build the table from. The data source must have a Clip column, followed by a column for each variable to replace.

Sizing sets whether the symbols are scaled to fit a cell of the table. Choose Auto or Fixed.

Label Sizing indicates whether or not the labels are scaled to fit a cell of the table.

Horizontal and Vertical Alignment specify how the table elements should be aligned. Items are aligned by the center point of the symbols that define them. Design the symbols based on the alignment to be used. For example, when you use left top alignment, the center point should be at the left top of the symbol. When you use center bottom alignment, the center point should be at the center bottom of the symbol.

Border, Border Color, and Border Thickness determine whether or not lines are drawn around table cells, set the line color, and set the width of borders and grid lines.

Rows and Columns specify the number of rows and columns in the table.

Row and Column Labels specify a string of comma-delimited headings to be used for row and column labels, respectively.

Label Format indicates which symbol in the external symbol file to use for label font information.

External Symbol File sets the path to an external Generator template containing the symbols to use for table labels and values.

Default Symbol is the name of the symbol to use for all cells in the table. If you choose to specify the columns in the data source by referencing variables in the default symbol file, the data source file should have only columns for variables to replace (no Clip column).

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Creating Generator Objects 41

Page 42: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Plotting dataWith the Plot object, you can position movie clip and graphic symbols within a rectangular region on the Stage based on variable values defined in a data source.

The Plot command uses its own data source. The data source must have three columns: Clip, X, and Y. In the Clip column, specify the movie clip or graphic symbol to plot. In the X and Y columns, specify the X and Y plotting positions for the symbols. The top left corner of the Plot object represents the (0, 0) X, Y coordinate of the Plot command. All X and Y coordinates in the data source are relative to this (0, 0) coordinate.

Optionally, you can specify X-scale, Y-scale, and Rotate columns. X-scale and Y-scale allow you to specify the scale of the movie clip. If you do not specify scales for movie clips, their original size is used. Rotate allows you to rotate the clip. If you do not specify it, the clip is not rotated. You can create additional columns to specify variables for the movie clip.

The Instance Name column specifies instance name values for plotted symbols within the parent clip; the Plot command targets individual plotted instances instead of the parent plot.

When authoring movies for Flash 2 export that use the Plot command, make sure that the main timeline and any clips that are being plotted have the same number of frames.

Plot has the following properties in the Generator panel:

Data Source specifies the data source that contains the plotting information.

Min X-Pos and Max X-Pos specify the minimum and maximum values assigned to the left and right edge, respectively, of the object box.

Min Y-Pos and Max Y-Pos specify the minimum and maximum values assigned to the top and bottom edge, respectively, of the object box.

Border, Border Color, and Border Thickness determine whether or not lines are drawn around pie slices, set the line color, and set the line thickness, respectively.

Instance Name identifies the instance of the parent Plot object so that it can be used with actions such as with and setProperty. To specify instance names for symbols you have inserted with the Plot object, use the instanceName column in the data source. You can also specify a name you have chosen for this column for the Instance Column parameter. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

X Column is the heading for the X column in the data source, if it is not X.

Y Column is the heading for the Y column in the data source, if it is not Y.

X-Scale Column is the heading for the X-Scale column in the data source, if it is not X-Scale.

Chapter 242

Page 43: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Y-Scale Column is the heading for the Y-Scale column in the data source, if it is not Y-Scale.

Rotate Column is the heading for the Rotate column in the data source, if it is not Rotate.

Symbol Name Column is the heading for the Symbol Name column in the data source, if it is not Symbol Name.

Instance Column is the heading for the Instance column in the data source, if it is not instanceName.

Creating basic chartsYou can create charts dynamically based on an external data source. Using the Basic Chart object from the Generator Objects palette, you can create a variety of charts, including bar, line, area, and scatter charts.

Clockwise from upper left: bar chart, scatter chart, area chart, and line chart

The columns of the data source vary depending on the type of chart you want to generate.

Line and area charts require a Value column. The value specifies the relative height of a point in the chart.

Creating Generator Objects 43

Page 44: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Bar charts also require a Value column. The value specifies the relative height of the bar. You can optionally provide a Color column as well as URL, Window, Goto, Gotolabel, and Hlabel columns. URL can be any valid URL. Window can be one of the following values: _self, _blank, _parent, or _top. Goto is a frame number in the parent timeline. Gotolabel is a label in the parent timeline. Hlabel is the text for the label on the horizontal axis. Adding URL, Goto, or Gotolabel makes the bar a button that jumps to the specified location when the user clicks it.

Stacked bar, stacked area, and stacked line charts require a Color column and a series of Value columns (value1, value2, ...., valuen).

Scatter charts require X and Y columns. A Symbol column can be included to plot points with symbols. If symbols are not used, the points are plotted with dots. You can also specify a Color column, which is used for the system default shape, and an Hlabel column, which defines the text for the label on the horizontal axis.

Basic charts have the following properties in the Generator panel:

Note: Each property is supported by all chart types unless otherwise noted.

Data Source specifies the file name, relative or absolute URL, database connection URL, or Java class URL from which Generator will obtain the data. You can specify multiple data sources when creating line or scatter charts by entering a semicolon-delimited list of data sources.

Chart Type specifies the type of chart to create.

Plot Symbol is the name of the symbol in the library to use for plotting points in scatter charts. See “Identifying symbols in the library” on page 22 for more information.

Max Data Entries controls the number of values displayed in the chart (both the maximum permitted and the minimum number for which space is allotted). For example, if Max Data Entries is set to 10, no more than the first 10 values from the data source are plotted in the chart, and the remaining values in the data source are ignored. If Max Data Entries is set to 10 and only 5 values are provided, Generator renders those 5 values provided in the first half of the chart only. When set to Default or left blank, Max Data Entries has no effect on the chart; the number of values in the data source are displayed in the full width of the chart. Applies to all chart types except scatter.

Gap sets the amount of space to appear between objects plotted in the chart. Each unit is equal to 1/20 of a pixel. Applies to bar and stacked bar charts only.

3D Depth specifies the amount of depth to render in the chart (how deep data are plotted along the Z-axis). Each unit equals 1/20 of a pixel. Applies to all chart types except scatter.

Labels specifies whether labels should appear along the Y-axis of the chart.

Label Format sets the font to use for the chart labels along the X and Y axes.

Chapter 244

Page 45: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Horizontal Label Orientation specifies whether the orientation of labels along the X-axis of the chart is vertical or horizontal. Requires an Hlabel column in the data source.

Horizontal Label Scale specifies the size of the label. The label can be scaled to fit the chart element (Scale to Fit) or displayed at the symbol size (Fixed). Half and Double display the symbol at half or double its original size, respectively. You can also enter a numerical scale factor to apply to the symbol. For example, entering 0.25 scales the label to one-quarter of the symbol size.

Value Display specifies whether the numeric value data should appear in the chart (Always or Never), or whether it is visible only when the pointer is over the chart area (Rollover). Applies to bar, stacked bar, and scatter charts only.

Value Scale indicates whether or not the text that displays the value data, when Value Display is set to Always or Rollover, should scale to fit within the chart element’s area or within a fixed size. Applies to bar, stacked bar, and scatter charts only.

Value Format sets the font to use for the chart value labels appearing within the body of the chart. Applies to bar, stacked bar, and scatter charts only.

Value Placement specifies where value labels should be positioned within a bar chart. Applies to bar, stacked bar, and scatter charts only.

External Symbol File specifies the path to an external Generator template containing the symbols to use for chart labels and values. If you are creating a scatter chart and use position labels, you must specify a symbol file. If Labels is set to On, the file must have a symbol named chartLabel1 containing the variable {label}, and chartValue1 with the variable {value} for values. Labels are available to all chart types; values are available to bar, stacked bar, and scatter charts only.

Grid Lines specifies whether or not grid lines are displayed behind the chart elements.

Grid Scales has Generator calculate the number and position of grid lines automatically (Auto) or calculate the position for the number of grid lines specified by the Major and Minor Grid Lines properties (Manual).

Major Grid Lines specifies the number of the bolder grid lines that are drawn in the chart when Grid Lines is set to On and Grid Scales is set to Manual.

Minor Grid Lines specifies the number of lines between the bolder grid lines that are drawn in the chart when Grid Lines is set to On and Grid Scales is set to Manual.

Creating Generator Objects 45

Page 46: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Min Y-Pos Type specifies the minimum value of the chart (Absolute), or adjusts the chart’s minimum value to the data by calculating a minimum value as a function of the range that the data spans (Relative Percent). When Relative Percent is specified, the minimum value on the chart is the minimum data value minus the difference between the data’s maximum and minimum values multiplied by the percentage specified for Min Y-Pos. This calculation is according to the following formula:

Minimum chart value = Minimum value - (Maximum value - Minimum value) x Min Y-Pos

Min Y-Pos is an integer value specifying the lowest value represented in the chart when Min Y-Pos Type is set to Absolute. When Min Y-Pos Type is set to Relative Percent, the value for Min-Y Pos is the percentage that Generator uses to calculate the minimum value for the chart.

Max Y-Pos Type specifies the maximum value of the chart (Absolute) or adjusts the chart’s maximum value to the data by calculating a maximum value as a function of the range that the data spans (Relative Percent). When Relative Percent is specified, the maximum value on the chart is the maximum data value plus the difference between the data’s maximum and minimum values multiplied by the percentage specified for Max Y-Pos. This calculation is according to the following formula:

Maximum chart value = Maximum value + (Maximum value - Minimum value) x Max Y-Pos

Max Y-Pos is an integer value specifying the highest value represented in the chart when Max Y-Pos Type is set to Absolute. When Max Y-Pos Type is set to Relative Percent, the value in Max-Y Pos is the percentage that Generator uses to calculate the maximum value of the chart.

Origin specifies the positioning of the values equaling zero in the chart. Positive values permit all values in the chart to be shifted above the bottom line of the X-axis in the chart by the specified amount. Negative values shift values down toward the bottom line of the X-axis by the specified amount. Applies to all chart types except stacked bar.

Border toggles a bounding rectangle around the chart object displayed in the color value specified in the Color property.

Border Thickness specifies the width of the chart object’s border and major grid lines. Each unit equals 1/20 of a pixel.

Line Thickness specifies the width of lines that display data in the chart.

Color sets the Web-safe color name (for example, black), Web hexadecimal value (for example, #3434aa), or regular hexadecimal value (for example, 0x232356) of the color for the chart. For bar, stacked bar, stacked area, stacked line, and scatter chart types this value applies only to the grid lines and borders of the chart. For line and area charts, this value is also used to render the chart line or filled area of the chart.

Chapter 246

Page 47: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

You can create bar charts that display data horizontally, at an angle, or even upside down, by rotating the Basic Chart object and chart labels. Use the instructions that follow to create a simple horizontal bar chart.

To create a horizontal chart label symbol file:

1 In a new document, open the default symbol file as a library. The Default Symbol library is located in the bin folder at the root of the Generator 2 installation folder.

2 Drag the chartLabel1 and chartValue1 symbols to the Stage, and close the Default Symbol library. This is to ensure that you edit instances of the symbols and not the actual symbols in the Default Symbol library. If you edit the symbols in the Default Symbol library, you may have problems with you chart labels in the future.

3 Delete the instances of chartLabel1 and chartValue1 on the Stage, and double-click the chartValue1 symbol to edit the symbol (not an instance of the symbol) on the Stage.

4 Use the Rotate tool to rotate the chartValue1 symbol counterclockwise 90°.

5 Double-click the chartValue1 symbol in the library, to verify that it has been rotated.

6 Select Generator in the Publish Settings dialog box, choose File > Export Movie, and select a folder for your horizontal chart.

To create a Horizontal Chart object:

1 Drag the Basic Chart object onto the Stage.

2 Use the Rotate tool to rotate the gray object box clockwise 90°.

3 In the Generator panel, specify the following:

• Labels: off

• Grid lines: off

• Value Placement: Over Bar

• External Symbol File: the name of the symbol file (SWT) containing the chartLabel1 and the rotated chartValue1 symbols created previously

4 Select Generator in the Publish Settings dialog box, choose File > Export Movie, and select the folder where the external symbol file you created is located.

5 Choose Control > Test Movie to view your horizontal chart.

Creating Generator Objects 47

Page 48: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Inserting pie chartsYou can create a pie chart dynamically based on an external data source.

Pie charts have the following properties in the Generator panel:

Data Source specifies the file name, relative or absolute URL, database connection URL, or Java class URL from which Generator will obtain the data. You must specify Value and Color columns.

Depth specifies the amount of depth to render in the chart (how deep along the Z-axis in units equal to 1/20 of a pixel).

Value Display specifies whether the numeric value data should appear in the chart (Always or Never), or whether it will be visible only when the pointer is over the chart area (Rollover). Applies to bar, stacked bar, and scatter charts only.

Border displays or hides a bounding rectangle around the chart object displayed in the color value specified in the Color property.

Value Format sets the font for the chart value labels appearing within the body of the chart.

Value Position specifies whether or not the value label should be positioned inside each pie slice or outside the pie slice in the margins, or whether its position should be automatically determined by Generator based upon the size of the label and the visible area of the slice.

External Symbol File identifies the path to an external Generator template containing the symbols to use for chart labels and values. If Labels is set to On, the file must have a symbol named chartLabel1 containing the variable {label} and another symbol named chartValue1 with the variable {value} for values.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Line Thickness specifies the width of the chart object’s border and grid lines (both major and minor). Each unit equals 1/20 of a pixel.

Color sets the Web-safe color name (for example, black), Web hexadecimal value (for example, #3434aa), or regular hexadecimal value (for example, 0x232356) of the color for the outlines and border of the chart.

Chapter 248

Page 49: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Inserting stock chartsYou can create a stock chart dynamically based on an external data source.

Stock charts have the following properties in the Generator panel:

Data source specifies the data source from which to build the chart. The data needs to consist of four columns: Open, Close, High, and Low.

Chart Type specifies the type of stock chart to create.

Max Data Entries controls the number of values displayed in the chart (both the maximum permitted and the minimum number for which space is allotted). For example, if Max Data Entries is set to 10, no more than the first 10 values from the data source are plotted in the chart, and the remaining values in the data source are ignored. If Max Data Entries is set to 10 and only 5 values are provided, Generator renders those 5 values provided in the first half of the chart only (50% of the charting area). When set to Default or left blank, Max Data Entries has no effect on the chart; the number of values in the data source are displayed in the full width of the chart.

Start Offset specifies how far to the right of the left vertical axis to start plotting data. The default is 0.

Gap specifies the gap between bars. The default is 0.

Grid Scales has Generator calculate the number and position of grid lines automatically (Auto) or calculate the position for the number of grid lines specified by the Major and Minor Grid Lines properties (Manual).

Labels specifies whether or not labels should appear along the X-axis of the chart.

Horizontal Label Orientation specifies whether the orientation of labels on the X-axis is vertical or horizontal.

Creating Generator Objects 49

Page 50: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Horizontal Label Scale specifies the size of the label. The label can be scaled to fit the chart element (Scale to Fit) or displayed at the symbol size (Fixed). Half and Double display the symbol at half or double its original size, respectively. You can also enter a numerical scale factor to apply to the symbol. For example, entering 0.25 scales the label to one-quarter of the symbol size.

Grid Lines specifies whether or not grid lines are displayed behind the chart elements.

Value Display specifies whether the numeric value data should appear in the chart (Always or Never) or should be visible only when the pointer is over the chart area (Rollover).

Value Scale indicates whether or not the text that displays the value data, when Value Display is set to Always or Rollover, should scale to fit within the chart element’s area or within a fixed size. Half and Double display the symbol at half or double its original size, respectively. You can also enter a numerical scale factor to apply to the symbol. For example, entering 0.25 scales the label to one-quarter of the symbol size.

Value to Display displays any of the following values: Open, Close, High, or Low.

Value Placement specifies where value labels should be positioned within the chart.

Major Grid Lines specifies the number of the bolder grid lines that are drawn in the chart when Grid Lines is set to On and Grid Scales is set to Manual. Must be an integer value.

Minor Grid Lines specifies the number of lines between the bolder grid lines that are drawn in the chart when Grid Lines is set to On and Grid Scales is set to Manual. Must be an integer value.

Min Y-Pos Type specifies whether the minimum value of the chart is fixed at the value represented in Min Y-Pos or calculated by multiplying the lowest value by the percentage given in Min Y-Pos. The Min Y-Pos Type Relative Percent is used to ensure that the lowest value found in the data source is always n percent above the minimum value in the chart.

Min Y-Pos is an integer that specifies the lowest value represented in the chart when Min Y-Pos Type is set to Absolute. When Min Y-Pos Type is set to Relative Percent, the value in Min Y-Pos is interpreted as a percentage and used to position the lowest value found in the data source at n percent above the minimum value of the chart.

Max Y-Pos Type specifies whether the maximum value of the chart is fixed at the value represented in Max Y-Pos or calculated by multiplying the highest value by the percentage given in Max Y-Pos. Relative percent is used to ensure that the highest value found in the data source is always n percent below the maximum value in the chart.

Chapter 250

Page 51: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Max Y-Pos is an integer value that specifies the highest value represented in the chart when Max Y-Pos Type is set to Absolute. When Max Y-Pos Type is set to Relative Percent, the value in Max Y-Pos is interpreted as a percentage and used to position the highest value found in the data source at n percent below the maximum value of the chart.

Border toggles a bounding rectangle around the chart object. The rectangle’s color is the color specified in the Color property.

Border Thickness specifies the width of the chart object’s border and grid lines (both major and minor). Each unit equals 1/20 of a pixel.

Line Thickness specifies the width of lines that display data in the chart.

Open Column is the heading for the Open column in the data source, if it is not Open.

Close Column is the heading for the Close column for values in the data source, if it is not Close.

High Column is the heading for the High column for values in the data source, if it is not High.

Low Column is the heading for the Low column for values in the data source, if it is not Low.

Label Format specifies the font for the chart labels along the X and Y axes.

Value Format specifies the font for the chart value labels appearing within the body of the chart.

External Symbol File specifies the path to an external Generator template (SWT file) containing the symbols to use for chart labels and values. If Labels is set to On, the file must have a symbol named chartLabel1 containing the variable {label} and a symbol named chartValue1 with the variable {value} for values. See “Identifying symbols in the library” on page 22 for more information.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Color specifies the Web-safe color name (for example, black), Web hexadecimal value (for example, #3434aa), or regular hexadecimal value (for example, 0x232356) of the color for the chart.

Creating Generator Objects 51

Page 52: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using the Radio Button objectYou can add sets of radio buttons to Generator templates using the Radio Button object. The number of radio buttons in a set is determined by the number of rows in the data source, with each row containing the name of one radio button. The text formatting for the button names is applied using the text characteristics you define for the Text symbol. The appearance of the radio buttons in the On and Off state is defined by the On and Off symbols included with the object, or by symbols that you specify for this purpose. Using the Selected Button Variable property and the Instance Name property of the Radio Button object you can send information about which radio button is selected to a URL, database, or script on a server. See “Using the Selected Button Variable property” on page 53 for more information.

The Radio Button object has the following properties in the Generator panel:

Data Source specifies the text for each button and the number of radio buttons to create. Each row in the data source consists of a text string for a button. One radio button is created for each row in the data source. The only required column in the data source is Text, which consists of a string to identify each button.

On Symbol is a symbol in the current SWT file that defines the appearance of the radio button when it is set to On (selected). Setting this parameter is optional. If you do not specify a symbol, Generator will use a standard On radio button (filled circle) shape. The default setting is blank.

Off Symbol is a symbol in the current SWT file that defines the appearance of the radio button when it is set to Off (not selected). Setting this parameter is optional. If you do not specify a symbol, Generator will use a standard Off radio button (empty circle) shape. The default setting is blank.

Text Symbol is a symbol defined in the current SWT file that defines the text characteristics used for the button label. This symbol must contain a Generator variable {text}. Setting this parameter is required.

Line spacing specifies the amount of space between the lines of radio buttons. Each unit equals 1/20 of a pixel. Valid values include all integers, and the default setting is 50.

Chapter 252

Page 53: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Selected by Default specifies the radio button (by number) that is selected by default. The number assigned to each radio button is determined by its place in the data source—the button in the first row is 1, the button in the second row is 2, and so on. Valid values are 0, 1, 2, 3,... up to the number of radio buttons specified in the data source. Enter 0 if you do not want any of the buttons to be active by default. If a value outside the range of allowable numbers (less than 0 or greater than the number of buttons) is specified, a warning message is generated and the default value (1) is used.

Selected Button Variable is the name of the variable used to indicate which button in the set is selected. This variable is necessary for attaching actions such as GoToURL or TellTarget. The default variable name is radioVar. See “Using the Selected Button Variable property” on page 53 for more information.

Instance Name identifies the instance of the object so that it can be used with actions such as with and setProperty. See “Using variables as parameters for Flash actions” on page 26 for more information on using this property.

Using the Selected Button Variable property

The Selected Button Variable property allows you to specify a variable to pass the number of the selected radio button to a text field or movie clip within the Generator template, or to an outside source such as a URL, database, or CGI or other script. The instructions in this section demonstrate how to use the Selected Button Variable property, radioVar (default value), to display the number of the selected radio button in a text field within the current template file, and send the value (number) to a server-side script.

Displaying the value in the text field is merely a way of verifying that the variable is functioning using Control > Test Movie.

To display the number of a selected radio button and pass it to a server-side script:

1 Drag the Radio Button object onto the Stage, and double-click the object to display the Generator panel.

2 Create a data source for the Radio Button object containing the following information:

#textButton1Button2Button3Button4

3 Use the Text tool to create the variable {text} using the font, color, and text size that you wish to use for your radio button labels.

4 Save the symbol as a graphic symbol.

Creating Generator Objects 53

Page 54: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

5 Enter the name of this symbol for the Text Symbol property in the Generator panel.

6 Use the Text tool to create a text field, making sure that Dynamic Text is selected in the Text options panel (Window > Panels > Text option).

7 In the Text options panel, enter myVar in the Variable field.

8 Create a simple button symbol with the label Submit.

9 Select the button on the Stage, choose Window > Actions, and select setVariable from the Toolbox list.

10 In the Variable field, enter myVar.

11 In the Value field, enter the instance name of the Radio Button object and the name of the selected button variable, separated by a period, as follows:

radioButton.radioVar.

The instance name and selected button variable name you enter here must match the entries in the Generator panel.

12 Select the Expression check box next to the Value field.

Your code should look like this:

on (release) {myVar = radioButton.radioVar;

}

13 Select Generator in the Publish Settings dialog box, and choose Control > Test Movie.

In the movie, the number of the selected radio button appears in the text field when you click the Submit button.

The following steps are optional and can be used by users who want to send the value of the selected radio button variable to a CGI script, or other application on their server.

14 In the Actions panel, choose getURL from the Toolbox list, enter the URL for the destination server in the URL field, and choose Send using GET from the Variables drop-down menu.

Note: You could also use the loadMovie action to send the value of the variable to the server.

15 Verify the action script entered in the field on the left:

on (release) {myVar = radioButton.radioVar;getURL ("http://yourserver.com/cgi-bin", “ “ , “GET”);

}

Chapter 254

Page 55: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

3

CHAPTER 3

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Dynamically Modifying Instances

Generator can dynamically insert and modify movie clips and graphic symbols when processing a template. You can replace a symbol with a different symbol from the library, or change the color of a symbol based on values provided when the template is processed. For example, if you are creating a temperature display, you can use the Set Tint command to change the temperature text color to red for warmer values or blue for cooler values.

Symbol commands are applied to symbol instances (either in the main Timeline or in child timelines of movie clips or graphic symbols stored in the library). Therefore, Generator’s symbol commands are available in the Generator panel only when a symbol instance is selected.

See Using Flash for detailed information on creating symbols.

You can apply only one symbol command at a time to a symbol instance. If you need to use more than one symbol command, such as Transform and Set Alpha, place the original symbol instance inside a movie clip or graphic symbol. Nesting this way allows you to apply a symbol command to the original instance inside the new symbol and another command to the instance of the new symbol on the Stage.

55

Page 56: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Replacing movie clips and graphic symbol instancesYou can dynamically replace one movie clip or graphic symbol instance with another when a template is processed. You replace the movie clip or symbol instance with another from the template’s library or from another template’s library. To identify the other template, you use the External Media option in the Publish Settings dialog box. See Chapter 5, “Processing Templates with Generator.”

To replace movie clips and graphic symbols:

1 Place on the Stage any movie clips and graphic symbols that you’d like to replace with other symbols contained within the movie.

2 Make sure the Generator panel is displayed by choosing Window > Panels > Generator.

3 Select an instance on the Stage.

4 In the Generator panel, choose Replace from the pop-up menu.

5 Click Symbol Name and type a either a valid symbol name or a variable name in the Parameters text box using the {variableName} syntax.

6 Make sure that Replace Symbol is set to True or the symbol will not be replaced when the movie is generated. Alternatively, you can specify a variable name that will contain a True or False value when the template is processed. The value can be supplied, for example, by the outcome or return result of an ASP, Cold Fusion, or CGI application.

In this example, the car on the left has a Replace Symbol command attached to it. When the movie is generated, the car on the right appears in the movie.

7 Repeat steps 2 through 6 for each symbol you want to replace.

Chapter 356

Page 57: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Replicating a movie clip or graphic symbolThe Replicate command lets you display movie clips or graphics sequentially. The command displays a movie clip or graphic symbol for each row of data in a data source. This can be useful for creating animated sports scoreboards or sequential displays of data, such as might be returned from a database query.

When you apply the Replicate command to a movie clip or graphic symbol, the original symbol determines the uses for values and objects in subsequent movie clips by doing the following:

• Providing variables to be filled in with values from each row of the Replicate command’s data source.

• Containing variables that specify other symbols to plot or insert.

• Declaring variables as frame labels or within actions.

• Serving as a parent Timeline to other Generator objects or commands included within the original symbol.

Dynamically Modifying Instances 57

Page 58: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

The Replicate command uses its own data source. The data source must have at least one column and one row, but it does not require any mandatory column names. Instead, all columns in a row are used to specify variables for the replicated movie clip.

The Replicate command builds a movie clip using the data from each row of the data source to populate the variables included in the symbol.

Chapter 358

Page 59: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

To replicate a movie clip or graphic symbol:

1 Create a movie clip or graphic symbol that you want to replicate. Within the symbol, place variables and actions that you want to be defined by the data source when the template is generated.

Usually, the symbol contains variables specified in text blocks and actions, and it may include other Generator objects. Generator fills in all variables when it processes the template.

2 Make sure the Generator panel is displayed by choosing Window > Panels > Generator.

3 Place an instance of the symbol on the Stage, and then select it.

4 In the Generator panel, choose Replicate from the pop-up menu.

5 Select Data Source and specify the data source in the Parameters text box.

6 For Expand Frames, if you are creating templates in Flash 3 or later format, set the option to False. If you are creating Flash 2-compatible templates, set the option to True.

Dynamically Modifying Instances 59

Page 60: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Setting transparency You can use variables defined in a data source to modify the alpha transparency of movie clips and graphic symbols, specifying a percentage of 0 to 100.

To set the alpha channel:

1 Create a movie clip or graphic symbol and place an instance of the symbol on the Stage.

2 Make sure the Generator panel is displayed by choosing Window > Panels > Generator.

3 Select the symbol instance.

4 In the Generator panel, choose Set Alpha from the pop-up menu.

5 Specify a variable for Percent using the {variableName} syntax or specify a value from 0 to 100.

Chapter 360

Page 61: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Setting brightnessYou can use variables defined in a data source to modify the brightness of movie clips and graphic symbols. Set Brightness adjusts the brightness percentage of the instance. You specify a percentage from -100 to 100. Positive values increase brightness; negative values reduce brightness. A value of 0 specifies no change to brightness.

To set the brightness of an instance:

1 Create a movie clip or graphic symbol and place an instance of the symbol on the Stage.

2 Make sure the Generator panel is displayed by choosing Window > Panels > Generator.

3 Select the symbol instance.

4 In the Generator panel, choose Set Brightness from the pop-up menu.

5 Specify a variable for the Percent using the {variableName} syntax or specify a value from -100 to 100.

Setting tintYou can use variables defined in a data source to modify the tint of movie clips and graphic symbols. Set Tint applies a tint to all colors of the instance. You specify a percentage (0% to 100%) and an integer value of 0 to 255 for red, green, and blue. The red, green, and blue values specify the tint color, while the percentage value governs the degree of the tint color applied.

You can use Set Tint to change an object to a solid color by setting the appropriate RGB values and specifying a Percent value of 100%.

To set the tint of an instance:

1 Create a movie clip or graphic symbol and place an instance of the symbol on the Stage.

2 Make sure the Generator panel is displayed by choosing Window > Panels > Generator.

3 Select the symbol instance.

4 In the Generator panel, choose Set Tint from the pop-up menu.

5 Specify either a variable or a value for the Percent, Red, Green, and Blue options.

Dynamically Modifying Instances 61

Page 62: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Specifying a custom colorThe Set Custom Color command specifies new color values for a symbol based on percentages and offsets of the symbol’s current RGB and alpha values.

Note: You should use Set Tint rather than Set Custom Color to change an object to a solid color.

The Percentage setting changes the color of a symbol by multiplying the percentage by the values in the channel. The Offset setting adds the offset value to or subtracts the value from the channel as a whole. The overall calculation for the new color is as follows:

Percentage x Current Value + Offset = New Color Value

To specify a custom color for an instance:

1 Create a movie clip or graphic symbol and place an instance of the symbol on the Stage.

2 Make sure the Generator panel is displayed by choosing Window > Panels > Generator.

3 Select the symbol instance.

4 In the Generator panel, choose Set Custom Color from the pop-up menu.

5 Specify either a variable or a value for the following fields:

• Percent Red, Percent Green, Percent Blue, and Percent Alpha specify the percentage of the symbol’s red, green, blue, and alpha values to use in the new color value. Valid values range from -100 to 100.

• Offset Red, Offset Green, Offset Blue, and Offset Alpha specify how much to increase or decrease the respective channels value.

Because percentage and offset values act on the channel as a whole, they are applied to all color values that appear within the symbol. For example, say you have three objects in one symbol: one red (RGB = 255, 0, 0), one gray (RGB = 125, 125, 125), and one black (RGB = 0, 0, 0). You apply the following values for Set Custom Color:

Percent Red 50Offset Red 0Percent Green 50Offset Green 0Percent Blue 50Offset Blue 0Percent Alpha 100Offset Alpha 0

Chapter 362

Page 63: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

The calculations to obtain the new color values would be performed as follows:

Red Object (RGB 255, 0, 0)Percent Red (50) x current value (255) + offset (0) =126.5

(round up to 127)Percent Green (50) x current value (0) + offset (0) =0Percent Red (50) x current value (0) + offset (0) =0

New Custom Color = 127, 0, 0Grey Object (RGB 125, 125, 125)

Percent Red (50) x current value (125) + offset (0) =62.5 (round up to 63)

Percent Green (50) x current value (125) + offset (0) =62.5 (round up to 63)

Percent Red (50) x current value (125) + offset (0) =62.5 (round up to 63)New Custom Color = 63, 63, 63Black Object (RGB 0, 0, 0)

Percent Red (50) x current value (0) + offset (0) =0Percent Green (50) x current value (0) + offset (0) =0Percent Red (50) x current value (0) + offset (0) =0

New Custom Color = 0, 0, 0

The sum effect of the Set Custom Color command on the symbol would be to lighten the red and gray objects only. The black object would not be changed.

Dynamically Modifying Instances 63

Page 64: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Guidelines for using Set Custom Color

These are important guidelines for using the Set Custom Color command:

• Negative numbers for percentage values generally are not useful. A negative percentage multiplied by a positive channel value yields a negative value for the channel. Because the RGB and alpha channel values are expressed exclusively in positive integers from 0 to 255, a negative value would always be treated as a value of 0 for the channel. Negative values for offsets, however, are useful for subtracting units from the channel.

• Because RGB and alpha channel values are fixed within the range of 0 to 255, calculations that result in numbers above or below this range default to the maximum or minimum value in the range accordingly.

• To specify that all objects within a group be modified to the same custom color, you can specify an RGB percentage of 0 and specify the custom color’s RGB values in positive offsets per channel. For example, to make everything medium purple (RGB 160, 0, 200), the settings for Set Custom Color would be as follows:

Percent Red 0Offset Red 160Percent Green 0Offset Green 0Percent Blue 0Offset Blue 200Percent Alpha 100Offset Alpha 0

A percentage value of 0 sets the original color value for a channel to 0. By placing the RGB values for the desired color in the Offset fields for each channel, you are specifying that every object in the channel be assigned that color. It is both easier and more efficient to use Set Tint for this purpose.

Chapter 364

Page 65: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Transforming movie clips and graphic symbolsThe Transform command lets you scale, rotate, and offset the position of an existing movie clip or graphic symbol within a template.

To transform a symbol:

1 Create a movie clip or graphic symbol and place an instance of it on the Stage.

2 Make sure the Generator panel is displayed by choosing Window > Panels > Generator.

3 Select the instance.

4 In the Generator panel, choose Transform from the pop-up menu.

5 Specify a literal value or a variable for any parameter using the {variableName} syntax, as follows:

• X-Scale and Y-Scale specify the factors to scale the instance horizontally and vertically, respectively. In the data source, valid values are 0.0 to 10.0; 1.0 produces no change.

• X Offset and Y Offset reposition the instance by the specified number of pixels when the movie is generated. The instance is moved relative to its registration point.

• Rotation specifies the degrees to which the instance is rotated. Negative numbers (–) rotate the instance to the left; positive numbers (+) rotate the instance to the right.

Dynamically Modifying Instances 65

Page 66: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Chapter 366

Page 67: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

4

CHAPTER 4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Using Data Sources

When you create a template, you assign to it data sources that contain values for variables in the template. For example, a data source can specify text, symbol names, or paths to external image files to be inserted when the template is processed. You can assign a data source to the main timeline of a template and to timelines of movie clips, as well as to specific Generator objects.

A data source can be a comma-delimited text file, a URL that references a comma-delimited text file (either an actual file or a Web application that returns a text-only result), a result set from an SQL query passed through a JDBC/ODBC connection, a Java class, or a native data source. (A native data source is data stored directly in the template rather than in an external file. Using a native data source is a convenient way to enter test values during development.)

You can also pass defined variables through the URL (online processing) or the command line (offline processing).

Regardless of the type of data source you use, it must pass the data to Generator in an expected format. The Generator object to which you assign the data source determines the format in which data must be presented to Generator, and in some cases, it also determines specific columns that must also appear in the data source. See “Data Source Summary for Generator Objects” on page 119 for more information.

67

Page 68: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Data source formatWhen you assign a data source to the main timeline or a movie clip’s timeline using the Generator Environment Variable button, you can format data sources in two ways: Name/Value and Column Name/Value. The main difference between the two formats is the number of values a variable can have. Name/Value variables can have only one value per variable; Column Name/Value variables can have more than one value.

The Column Name/Value format is suited for multiple values and is required when you want to provide multiple sets (or records) of data to a command that takes multiple sets (Plot, Replicate, Scrolling List, Ticker, List, Chart, and so on).

Name/Value

The first line of this format must be as follows:

Name, Value

These column names are required. Each row is a separate line within the file; column values are separated by commas. Under the Name column, specify the variable names. Under the Value column, specify the variable values. Each variable can be assigned only one value. Quotation marks (“”) enclosing the values are optional as long as the value does not contain any embedded commas. Generally, it’s a good idea to enclose values within quotation marks to make sure they are fully encapsulated and treated as a single value.

Name, ValueVar1, "Value1"Var2, "Value2"Var3, "Value3"

Column Name/Value

This format requires that the first row of data specify the variable names and the following rows specify the values, as in the following example. Quotation marks (“”) enclosing the values are optional as long as the value does not contain any embedded commas. Generally, it’s a good idea to enclose values within quotation marks to make sure they are fully encapsulated and treated as a single value.

Var1, Var2, Var3"Value1", "Value2", "Value3""Value1a", "Value2a", "Value3a"

An SQL query statement creates a table more easily in this format than in the Name/Value format.

Chapter 468

Page 69: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using special characters in data sources

Generator reserves some characters for special uses within a data source. To insert reserved characters into a text string, you must use an escape character sequence beginning with a backslash (\). Use escape character sequences to format values in any type of data source. These modifications ensure that values are correctly displayed in the final generated output.

• Line break indicates that the current row of data has ended. Use the character sequence \r\n. Here’s an example that inserts a line break within a value:

"The first line.\r\nThe second line."

• Backslash (\) treats the next character as an escaped character. Use the character sequence \\ to indicate a literal backslash. Here’s an example that inserts a backslash within a value:

"Use a \\ in the directory path."

• Quotation mark (") indicates the beginning or end of a text string. Quotation marks must be used in pairs. Use the character sequence \". Here’s an example:

"He said - \"Yes, this will work.\""

• Comma (,) indicates that the current column of data has ended. A comma is not treated as a delimiter if it appears within a pair of quotation marks but instead is parsed as a literal comma. Here’s an example:

"A quoted comma, however, is a literal comma."

• Curly braces ({}) indicate that the string between the braces is a Generator variable. Use the character sequence {{ to specify a literal single opening curly brace. Here’s an example that inserts the curly braces along with the specified string:

"This is a string within {{ curly braces}}."

If values are obtained from databases or from HTTP or FTP requests, modification of the original data may not be necessary before passing the final values to Generator. Test these types of data sources thoroughly to determine whether modification is warranted. Several third-party Web application development tools, such as Microsoft Active Server Pages (ASP), Allaire ColdFusion, or any CGI-based scripting or programming environment, can be used to retrieve and modify the data before returning the formatted data source as output to Generator.

Here is an example of how to set a variable value containing special characters:

name, valuevar1, hello, worldvar2, "hello, world"var3, "\"hello, world\""

Using Data Sources 69

Page 70: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

When these variables are referenced, the following values will be returned:

• var1 = hello

• var2 = hello, world

• var3 = "hello, world"

Note: In Flash 5, ActionScript var (without the added numeral) is a reserved word and cannot be specified as a variable name.

Specifying color in data sources

When you specify a color in a data source, specify its value in one of the following ways: a Web-safe color name (for example, black), a Web hexadecimal value (for example, #3434aa), or a regular hexadecimal value (for example, 0x232356).

Specifying a Window column for a URL in the data source

If you specify a URL column in the data source, you have the option of specifying the window the URL opens into, by adding a Window column to the data source. The Window column may contain one of the following parameters:

• _self instructs the browser to load the URL into the current browser window or frame.

• _blank instructs the browser to load the URL into an new blank browser window.

• _top instructs the browser to load the URL into the top browser window in the current hierarchy of open windows.

• _parent instructs the browser to load the URL into the parent window of the child window or frame that contains the current Flash movie.

• string instructs the browser to open the URL into the browser window or frame specified in the string.

Any name specified for a window or frame is valid. If the name of the window specified in the string is not recognized, the browser opens a new window and assigns the name specified.

Chapter 470

Page 71: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

How Generator parses data sources

When Generator parses a data source entry in the Data Source parameter field or dialog box, it checks the first character to see if it is a pound sign (#). A pound sign directs Generator to treat the remainder of the entry as a native data source. If a pound sign is not present, Generator treats the entry as a reference from which to retrieve an external data source (for example, a path to a text file, an HTTP/FTP URL, an fgjdbc:// database URL, and so on).

In most cases, the Generator object or command governs how a data source must be formatted. With the exception of data sources specified with the Generator Environment Variable button, all Generator objects and commands that accept their own data source parse that data source in Column Name/Value format. When parsing a data source in Column Name/Value format, Generator expects all variables to be defined in the first row of the data source. Subsequent rows of the data source contain values for those variables—one set of values per line, terminated with a line break. Values are provided in the order in which they are declared in the first line. If you don’t provide a value for any variable in the original declaration, include a comma to indicate an empty value for that variable and to signal Generator to move to the next variable declaration in the list.

Data sources specified for a main timeline or a movie clip’s timeline using the Generator Environment Variable button can be in either Column Name or Name/Value format. However, the format must be specified to ensure that the data source is correctly parsed. Regardless of the format selected, data sources specified with the Generator Environment Variable button are restricted to a single value per variable (much like Windows or UNIX system environment variables). You can declare as many variables as you like, but each variable can have only one value. As Generator parses the data source line by line, it allocates memory for the variables encountered. If a variable is encountered more than once, the second occurrence is treated as a redefinition of the variable’s value, so the older value is replaced by the newer value.

When the Name/Value button is selected in the Generator Environment Variable dialog box, Generator requires that the first row of the data source contain the string “Name, Value” (the string is not case-sensitive). If “Name, Value” is not found in the first row, Generator cannot read the data source and an error is written to the Output window or log files. If “Name, Value” is found in the first row, Generator parses the data source using the first entry of each row as the variable name and the second entry as the value for that variable. Each row of the data source is read until no more lines are found.

When the Column Name/Value button is selected in the Generator Environment Variable dialog box, Generator uses the Column Name/Value method to read the data source. This setting is useful when you need to establish environment variables for a timeline using a database query. SQL SELECT queries return data in the Column Name/Value format easily. However, it is important to remember that the single value per variable restriction still applies; data sources with multiple rows result in a redefinition of the environment variables until the last line is reached. For this reason, restrict data sources in Column Name/Value format to a single row when using them with the Generator Environment Variable button.

Using Data Sources 71

Page 72: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Providing data sources to GeneratorYou can provide a data source to Generator in either of these ways:

• Assigning a data source to the timeline of the main movie or a movie clip using the Generator Environment Variable button

• Assigning data sources to specific Generator commands and objects that require them

Providing environment variables in the timeline

You can use the Generator Environment Variable command to assign a data source to the timeline of the main movie or a movie clip. Enter the file name for the data source in the dialog box that opens when you click the Generator Environment Variable icon to the upper right of the timeline. If you specify more than one data source, use a semicolon to separate the data source names.

Note: The Generator Environment Variable command can assign data sources only to the timelines of the main movie or a movie clip. This command has no effect for timelines of buttons or graphic symbols, even though the dialog box opens if you click the Generator Environment Variable button in these timelines.

You can also type the actual data source data in the Edit box if you want to store the data directly within the template. This approach is useful when you want to provide a few static values that are used repeatedly for the template but aren’t updated frequently, which saves the time and effort of managing a separate text file data source that would serve the same purpose. If you do type the data source directly into the Data Source window, you must begin the declaration with a pound sign (#). For example,

#NAME, VALUE x, 100 y, 200 z, 300

However, if you use the Column Name/Value format and provide multiple sets of values for an environment command (the Generator Environment Variable button in the timeline), then it’s important to note that only one set of values can be valid for the timeline; the last set appearing in the data source will be used. That is, each row of data overwrites the values for the variables from the previous row in the data source until no more rows are found.

Note: Scenes are an extension of the main timeline and are intended to help developers organize their content more efficiently in Flash. Scenes are not preserved as distinct timelines in the final exported SWF or SWT files; instead, all scenes are assembled sequentially in the main timeline. Scenes are an extension of the main timeline and, therefore, cannot have definitions of variables used elsewhere in the main timeline. Any variable that is not unique across scenes will be redefined using the last declaration found, which will apply to that variable for all scenes in the movie.

Chapter 472

Page 73: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

To use the Generator Environment Variable command:

1 Click the Generator Environment Variable button on the timeline of the main movie or a movie clip.

2 Choose Column Name/Value or Name/Value to specify how the data source is formatted.

3 If you are specifying a data source file name, type it in the box, or browse directories with the Browse button.

Remember to use relative paths (in relation to the template file) when you specify the data source. (When the template and the data source files are placed on the Web server, absolute paths would probably differ from those paths that were valid on your local machine.) If you use the Browse button in the Set Environment Variable dialog box when specifying a data source, an absolute path is entered. You may need to change the path to a relative path.

4 Click OK.

Using Data Sources 73

Page 74: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Assigning data sources to Generator objects and commands

The following Generator objects and commands require their own data sources:

• Basic Chart

• List

• Mulitpage List

• Pie Chart

• Plot

• Radio Button

• Scrolling List

• Stock Chart

• Ticker

• Table

• Replicate

You should provide data sources for these objects and commands in Column Name/Value format. Refer to the data source summary table in the appendix for a complete list of the required and optional columns for each Generator object.

Chapter 474

Page 75: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using JDBC/ODBC data sourcesYou can use any JDBC/ODBC-compliant database as a data source for a Generator template or object. In Windows, you must first register the data source to establish a mapping between the database and its driver to the system.

Note: JDBC/ODBC connectivity is not supported on the Macintosh. You can develop template files that use database connectivity on the Macintosh, but you will not be able to preview them until the templates are moved to a Windows or UNIX system with the required JDBC/ODBC drivers and databases installed.

Before attempting to use JDBC/ODBC connectivity, be sure to configure the data source on your local machine. Consult your operating system or database application documentation for specific instructions, as this process differs across platforms.

In Windows, be sure to configure the data source as a SystemDSN, instead of a User DSN. System DSNs are available to all users on the system (including the system itself and the account used by the Web server for anonymous HTTP requests). User DSNs are restricted to the user account that created them, and their use requires a login under such an account.

After registering your JDBC/ODBC data source, be sure to verify the connection to the database or data source through the driver. Some database applications provide utilities to test ODBC connections through the driver. Before you start attempting to connect to the database through Generator, it’s a good idea to be sure that you can indeed connect to the database through the ODBC driver. Finding and resolving problems at the driver level will save time and frustration when you begin to work with Generator.

To assign the ODBC data source to the template:

1 Display the template command or Generator object with which you want to associate the database.

2 Specify a URL similar to the following in the data source field:

fgjdbc:///?driver=sun.jdbc.odbc.JdbcOdbcDriver&url=jdbc:odbc:DataSourceName&userid=UserID&password=Password&query=SELECT%20*%20FROM%20TableName;

Note: When creating and testing your template, enter a variable in the data source field. In a text file associated with a Generator Environment Variable command, enter the special URL that contains your SQL query as the definition for the variable. This makes it easier to modify and test your queries as you develop the template. When you have completed and tested the template, replace the variable in the data source field with the final URL. Using the query directly in the data source field, rather than requiring a call to the file system for the text file, ensures the best performance.

Using Data Sources 75

Page 76: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

This URL is a special Generator extension that directs Generator to load a special module able to interpret the following arguments of the URL and make a database query. Because the query is specified as part of a URL, any spaces or other special characters in the data source must be URL-encoded.

fgjdbc:/// directs Generator to interpret the rest of the URL as a connect string and SQL query using JDBC extensions to Java.

?driver=sun.jdbc.odbc.JdbcOdbcDriver identifies the JDBC driver to use for the SQL query. This example uses the JDBC/ODBC bridge driver supplied with the Java Runtime Environment included with Generator. If you are connecting to an ODBC data source, use the value exactly as specified. This string would change, however, when using a native JDBC driver. For example, a native JDBC driver for Oracle might look like ?driver=oracle.jdbc.driver.OracleDriver. See the documentation for your database application or JDBC driver for specific details.

&url=jdbc:odbc:DataSourceName identifies the JDBC URL, which identifies the ODBC data source to open. For the JDBC/ODBC bridge, DataSourceName must match the name of the data source registered with ODBC. When using a pure JDBC driver, remove odbc:.

&userid=UserID identifies the user ID associated with the SQL query. You do not have to identify a user ID, but you must include at least &userid= in the URL.

&password=Password identifies the password associated with the SQL query. You do not have to identify a password, but you must include at least &password= in the URL.

&query=SELECT%20*%20FROM%20TableName; is the SQL query to run. The query used in this example corresponds to the following SQL statement, which retrieves all the records contained within the table:

SELECT * FROM TableName;

Generator can process any SQL statement that returns an SQL database table. Because the query is specified as part of a URL, any spaces or other special characters in the data source must be URL-encoded.

SQL INSERT, UPDATE, and DELETE statements are generally not useful for Generator objects because they do not return a database table or useful result set that Generator can interpret. If your project requires these types of database operations, consider pointing Generator objects to a URL for a Web application that handles these database operations and returns a useful result set to Generator. This strategy allows you to pass information to the Web application in the query string portion of the URL. The Web application (ASP, Cold Fusion, CGI, and so on) can accept these parameters, perform the database operations, provide error checking and exception handling, and return a meaningful data source to Generator as output for the HTTP request.

Chapter 476

Page 77: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using URL (HTTP, FTP, or FILE) data sourcesUsing URL data sources, you can obtain data from existing business processes, data storage systems, or data warehouses for use with Generator. For example, you can point Generator to an application that retrieves 100 records from a database, evaluate those records against a set of predefined criteria, and output the records that fulfill the criteria in the format of a Generator data source.

You can specify a data source using an HTTP://, FTP://, or FILE:/// address. The content returned from a request to the address must be a text file in the proper format. Using a URL data source lets you call a Perl script or other CGI application that processes and returns text. The URL can also point directly to a text file.

Both FTP and FGFTP URLs are supported by Generator. A normal FTP URL can be used if the FTP server does not require a user name and password for access to content on the server. If a user name and password are required (even if the user name is anonymous and the password is an e-mail address or any string value), use FGFTP:// and append the required information in Name/Value pairs to the end of the URL.

An FGFTP URL takes the following form:

fgftp://userName|password@FTP_HostName:portNumber/path/to/file.txt

fgftp:// tells Generator that it should interpret the rest of the URL as an FTP request using authentication.

userName is the user account to use to perform the FTP.

password is the password for the user name account.

FTP_HostName is the host name and specifies the FTP host to contact to fill the request.

portNumber is the machine’s port that is set up for FTP. The default value is 21.

path/to/file.txt is the path and file name for the file you want to FTP or gather data from.

Using Data Sources 77

Page 78: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using Java data sourcesYou can use a Java class as a data source. Custom Java class files can be installed in the classes subdirectory of the Generator installation folder, or you can specify a folder in the User Classpath field of the Generator tab using JRun Administrator. Generator looks for external Java class data sources in the classes folder before searching in any directories included in the User Classpath field.

The Java class must meet the following requirements:

• It must implement a static public method called getStream that accepts a single Hashtable type argument and returns an object of type InputStream.

• The getStream method must return either an InputStream object containing a valid Generator data source, or a NULL object if a valid data source cannot be provided when the Java class is called at run time.

If the Java class is included in an archive (JAR) file, be sure to include the archive name and .jar extension in the User Classpath entry. If the Java class references external libraries or .dlls, append the path to those dependencies to your system’s path environment variable so they can be found at run time.

JRun loads a Java class on the first call for it; after that it remains loaded by JRun and the instance is reused for subsequent calls to the class. When testing newer Java classes for use with Generator, you need to stop and restart JRun to purge the outdated class from memory and cause the newer class file to be loaded on the next call to it.

Chapter 478

Page 79: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Sample Java data source class

A sample Java data source class is shown here. This data source can be any Java class, but it must have the getStream method as defined in the sample class below. The getStream method is called by Generator, and it must return an inputStream object or a NULL object if the data source can not be returned.

import java.io.*;import java.util.*;

//// Sample data source class.//public class BlimpData{ // This method must be present in a Generator data source

class.public static InputStream getStream(Hashtable hashtable){

// Enumerate each key/value pair passed as an argument to this

// data source. These are the key value pairs passed on the URL.

Enumeration hashEnum = hashtable.keys();

// Enumerate each key within the hash table.while (hashEnum.hasMoreElements()){

// Get the hash table key.String hashKey = (String) hashEnum.nextElement();

// Using the hash table key, get the hash table value.String hashValue = (String) hashtable.get(hashKey);

// Use the hash table key/value pair as arguments for// accessing the custom data source. In this example,// these values are ignored and we pass back the static// data strings shown below to Generator.

}

// Create a string buffer to contain the data source.StringBuffer buffer = new StringBuffer();

// Reset the buffer size.buffer.setLength(0);

// The first line of a data source always contains the column names.

buffer.append("Sport, Date, City1, City2, Score1, Score2, Details\n");

// All other lines of a data source contain the comma-separated data.

Using Data Sources 79

Page 80: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

// Instead of listing data as shown in this example, // you may want to create a data source class that reads// the data from an external source and converts it to a

data stream// to be passed back to Generator. This data is formatted

for using // with the Replicate template command. It would need to be

in a different// format if it were used with the Generator Environment

Variable button// or Plot template command.buffer.append("NFL, 10/16/97, San Diego, Kansas City, 3, 3,

Final\n");buffer.append("NFL, 10/19/97, Jacksonville, Dallas, 22, 26,

Final\n");buffer.append("NFL, 10/19/97, Carolina, New Orleans, 13, 0,

Final\n");buffer.append("NFL, 10/19/97, New England, New York, 19, 24,

Final\n");buffer.append("NFL, 10/19/97, Arizona, Philadelphia, 10, 13,

Final / OT\n");buffer.append("NFL, 10/19/97, Seattle, St Louis, 17, 9,

Final\n");buffer.append("NFL, 10/19/97, Washington, Tennessee, 14, 28,

Final\n");buffer.append("NFL, 10/19/97, San Francisco, Atlanta, 35,

28, Final\n");buffer.append("NFL, 10/19/97, Miami, Baltimore, 24, 13,

Final\n");buffer.append("NFL, 10/19/97, Pittsburgh, Cincinnati, 26,

10, Final\n");buffer.append("NFL, 10/19/97, New York, Detroit, 26, 20,

Final / OT\n");buffer.append("NFL, 10/19/97, Denver, Oakland, 25, 28,

Final\n");buffer.append("NFL, 10/20/97, Buffalo, Indianapolis, 20, 9,

Final\n");

// Convert the string buffer to an input stream.InputStream inputStream = new

ByteArrayInputStream(buffer.toString().getBytes());

// Return the input stream to be parsed by Generator.return inputStream;

}}

Chapter 480

Page 81: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

To use a Java data source class:

1 Make sure that Flash and Generator are properly installed on your system or Web server.

2 Copy the compiled Java data source class to the classes folder within the Generator installation folder. For a standard Generator installation in Windows, this folder is C:\Program Files\Macromedia\Generator\classes. On UNIX systems, it would be similar to <generator parent>/classes.

3 In Flash, display the template command or Generator object with which you want to associate the Java class.

4 Specify a URL like the following in the data source field:

fgjava:///JavaClassName?SampleArg1=SampleValue1&SampleArg2=SampleValue2

This URL is a special Generator extension that directs Generator to load a special module that interprets the arguments of the URL and calls a Java class.

When the parameter names and values in the URL are processed by Generator, any + characters are turned to spaces, and characters specified in URL encoding (%xx) are converted back to characters. Also, the portion of the URL normally occupied by a host name must be empty.

Each section of this URL is described below:

fgjava:/// specifies to Generator that it should interpret the rest of the URL as a Java data source.

JavaClassName identifies the actual Java class to invoke as the data source. Notice that the class extension is not specified.

?SampleArg1=SampleValue1&SampleArg2=SampleValue2 specifies arguments to be passed to the Java data source class. These parameters are passed as members of a hash table to the data source class.

Using Data Sources 81

Page 82: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Working with cross-platform and localized data sourcesIf you are creating templates and data sources on operating systems other than those that will be serving or testing the template file, then you should specify the encoding system Generator uses when reading your data sources. If you don’t, Generator may not interpret the data correctly.

For example, if you create a data source on a system with Japanese SJIS character codes and then serve that data source from a system with an English operating system, Generator will read each byte as a character instead of using 2 bytes for each character, and thereby produce undesirable results.

Data sources created on Macintosh systems require MacRoman encoding when read by Windows or UNIX systems. Windows and UNIX systems commonly use ASCII encoding, but they can be altered to use other character encoding systems through operating system modification.

Generator supports encoding systems that cover U.S. English, Japanese, and most western European single-byte character encoding systems. It does not support fonts or foreign language characters that are not implemented using one of these standard character encoding systems.

Data source encoding specifies the encoding system to be used when reading all data sources referenced in the template file. Therefore, when you plan and create data sources for a template, you should use the same character encoding system for all the data sources.

To specify the data source encoding for all data sources referenced in the template file:

1 Choose File > Publish Settings.

2 Select Generator in the Formats tab.

3 Click the Generator tab.

4 Choose an encoding method from the Data Encoding option. Default uses the encoding method of the system from which the template is served.

Chapter 482

Page 83: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Processing several data sources in a templateBecause individual movie clips and objects in a Generator template can have their own data sources assigned to them, a Generator template typically contains multiple data sources.

When a Generator template has several data sources assigned to it, Generator searches each data source for variables and the values to assign them. The search starts with command-line parameters, followed by the main movie’s timeline data source assigned using the Generator Environment Variable button, and then any data sources assigned to child Generator objects and movie clip timelines.

If variables with the same name are assigned different values in data sources specified for child timelines of symbols, the new value overwrites the older value defined in parent timelines or the command line (or URL query string). If a child timeline doesn’t redefine a variable, the variable inherits its value from any parent timelines or the command line. If the variable is not declared in any timeline and is not passed on the command line or URL, the variable is left with no value assigned (or a blank value). At the end of this process, any variables that have not been assigned values are left blank, except action variables, which remain unchanged.

Be aware that scenes are an extension of the main timeline and are not preserved as distinct timelines in the final exported Flash Player movie or Generator template. Any variables that are not unique across scenes will be redefined using the last declaration found, which will apply to that variable for all scenes in the movie.

Using Data Sources 83

Page 84: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Chapter 484

Page 85: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

5

CHAPTER 5

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Processing Templates with Generator

When generating a movie, you can override the default frame rate, frame size, and background color by using the Publish Settings command. This lets you change the size of a generated movie you put into an HTML page without having to modify the movie, or generate a movie with different background colors to match different pages.

Before you place a finished template on a Web server, you should preview, export, and debug the template. Previewing a template lets you see how the template looks to users in their browsers. You can then export or save the Generator template as an SWT file.

85

Page 86: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using the Publish Settings commandThe Publish Settings command allows you to change Generator settings such as the default frame rate, frame size, and background color.

To change Generator settings:

1 Choose File > Publish Settings, then click the Generator tab.

2 Change any of the following settings:

• Width specifies the image width when converting to a file or stream. Select Match Movie to use the settings you specified with the Modify > Movies command while authoring the template.

• Height specifies the image height when converting to a file or stream. Select Match Movie to use the settings you specified with the Modify > Movies command while authoring the template.

• Background specifies a background color for the scenes of your movie. This value overrides the background color set with the Modify > Movies command. You can set the value for this option in three ways: a Web-safe color name (for example, black), a Web hexadecimal value (for example, #3434aa), or a regular hexadecimal value (for example, 0x232356).

• Frame Rate specifies how quickly the frames of the current movie are displayed when an animation is played back. The rate is specified in frames per second (fps). If you specify a frame rate of 10 fps, each frame of the animation appears on the screen for 1/10 of a second; a 100-frame animation plays for 10 seconds. This setting overrides the frame rate set with the Modify > Movies command.

• Load Order specifies the order in which you want layers to load for the first frame. Over a slow network or modem connection, Flash draws parts of the file as they become available. Use this option to determine what will appear first when the movie downloads.

Chapter 586

Page 87: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

• Data Encoding specifies the data encoding to use for data sources. See “Working with cross-platform and localized data sources” on page 82 for more information.

• Create External Font Files directs Generator to create font files. If you have the Enterprise Edition, these font files are cached and help with performance when many fonts are used in a movie.

• External Media specifies the name of the Generator template that contains the symbols you want to use in this template. Specifying this option includes the library from the specified file in the current file, allowing you to access symbols in that file as though they were native. If the same symbol is defined in both the external media file and the current file, the external media file’s symbol is used.

• Parameters is used to define variables. This is convenient for testing templates locally as part of development. Put the name of the variable in the Name text box and its value in the Value text box.

Note: You can use the Parameters option to test how variables will work when processed.

3 Preview the template. See “Previewing, debugging, and exporting templates” on page 88.

Processing Templates with Generator 87

Page 88: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Previewing, debugging, and exporting templatesPreviewing a template lets you check how the template looks in a browser and identify problems that you need to correct. You can then export or save the Generator template as a Generator template (SWT) file.

You can debug templates by examining the log shown in the Output window. The log provides information on how the template was processed. You can specify the level of detail you’d like shown in the report. When Generator processes the template, you can check for errors and determine where you need to correct the template.

Server debugging can be accomplished in a similar manner using the Generator.log file and adjusting the log detail level with JRun Admin utility.

For more troubleshooting tips, see the TechNotes in the Generator Support Center (http://www.macromedia.com/support/generator/).

Debugging and testing suggestions

• Develop and test in Flash using Control > Test Movie and the Output window.

• Create text file data sources to stand in for database or URL data sources. Verify that the templates work as expected using static data before attempting to integrate dynamic data. This also ensures a thorough knowledge of the template’s data source requirements.

• Examine the output of database queries or URL results using a browser or the Output window to ensure that the expected result is returned.

To preview a template:

1 Choose File > Publish Settings, then select Generator Template.

2 If desired, define variables in the Parameters text box using Name/Value pairs. (This lets you preview the template as if you were defining variables on the command line or through a URL. It is also convenient if you plan on using an external data source but haven’t created it yet.) Click OK.

3 Choose Control > Test Movie to preview the template.

The Output window appears to display any error, warning, or verbose message. If the debug level is set to None, then the Output window does not appear.

When previewing a template, Flash also exports a template (SWT file) and creates a Flash player movie (SWF file) that is a version of the previewed template.

Chapter 588

Page 89: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

To export a template:

1 Choose File > Export Movie.

2 Specify the template name.

3 Choose Generator Template (*.swt) from the Save as Type pop-up menu.

4 Click Save to export the movie.

To generate and view a debugging report:

1 Choose File > Publish Settings, then select Generator in the Format tab.

2 To display the Output window, choose Window > Output.

The Options menu allows you to copy and clear the window. It also allows you to save the log to a file. You can also set the level of detail for the log.

3 To set the log detail level, choose Options > Debug Level, then choose the level of errors you want reported: Errors lists only errors, Warnings lists both errors and warnings, and Verbose lists all Generator operations.

4 Choose Control > Test Movie to preview the template.

Processing Templates with Generator 89

Page 90: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Choosing online or offline processingAfter you create a Generator template using Flash, you copy it to a Web server along with any associated data sources and external media content. Once the template is on the server, Generator can process it either online or offline.

Online processing uses the Online Generator, which is a Web server extension that can be added to software such as the Microsoft Internet Information Server (IIS) or Netscape iPlanet on Windows NT, or Netscape Enterprise, iPlanet or Apache HTTP servers on Solaris, or iPlanet on Linux.

With the Online Generator, you insert a Generator template file in an HTML document. When the client browser opens that document, the Web server starts an instance of Generator to process the embedded template commands and to substitute variables with values defined in the template’s associated data source. After the template is processed, the resulting Flash player movie or GIF, JPEG, PNG, or QuickTime movie file is served to the client browser.

Note: The Online Generator acts as a service in Windows NT. It can be started and stopped with the JRun Service Manager in the Services Control Panel. If this service is turned off, the Online Generator cannot process template files.

The Offline Generator differs from the Online Generator in three main ways:

• The Offline Generator does not run as an extension of a Web server; it is started directly from a command line.

• The Offline Generator directs output to a Flash player movie, GIF, PNG, JPEG, or QuickTime movie file on the Web server rather than sending the output to a client browser. The Web server can then serve this output file as it does any other file of that type.

• The Offline Generator can be used to create image maps from Generator templates.

Generally, the Online Generator is better suited for Web sites where a new and unique Flash Player movie must be created for each visitor to the Web site. The Offline Generator is better suited for Web sites where the data source changes infrequently.

The main factor in choosing between online and offline processing is the amount of user information that dictates the content. Online processing is better when navigation or content is based on user information. Online generation delivers per-request customized content but requires significantly more server resources than merely serving static content per request. Use online generation when per-request customization (such as database drill downs and personalization) is a project requirement.

If the Web site content is the same for each user or requires infrequent content updates, choose offline processing to spare server resources while yielding the desired results.

Chapter 590

Page 91: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

The Generator caching feature included with the Enterprise Edition can be used with online or offline processing. Depending on how you enable and configure the caching feature, you can significantly reduce the load on the Web server, which in turn may influence whether you choose offline or online processing. See “Enabling and configuring Generator caching” on page 108 for more information.

Using HTML syntax for Generator templatesTo use the Online Generator to process a template, you should refer to the Generator template in an HTML document. The URL for the template file tells the Web server to start the Online Generator and process the template. You can generate Flash Player movie, GIF, JPEG, or PNG files by specifying a type switch on the URL as shown in the following table:

You can use both document-relative paths (as indicated in the table) or root-relative paths for the URL. Using the type switch is simpler because you don’t have to change the file extension of the template file.

When the output of the Online Generator is a Flash player movie, the URL can be embedded within an OBJECT or EMBED tag that specifies the Flash 5 player.

For example, here is the OBJECT tag for Internet Explorer:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"

WIDTH=500 HEIGHT=300 BORDER=1><PARAM NAME=movie VALUE="blimp.swt"><PARAM NAME=quality VALUE=best>

File Type URL Syntax

Flash File path/template.swt

path/template.swt?type=swf

GIF File path/template.swt?type=gif

JPEG File path/template.swt?type=jpg

PNG File path/template.swt?type=png

QuickTime File path/template.swt?type=mov

Processing Templates with Generator 91

Page 92: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

As another example, here is the EMBED tag for Netscape Navigator:

<EMBED PLUGINSPAGE=”http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash”

SRC="GenDemos/blimp/blimp.swt"WIDTH=500 HEIGHT=300 QUALITY=best TYPE="application/x-shockwave-flash">

</EMBED>

For offline generation, the output is static, so you reference the SWF, GIF, JPG, or PNG file directly instead of using the template.

For online generation, the template file is referenced with the appropriate type=aaa query string.

If you have the Enterprise Edition of Generator, the URL parameter for a template file may also specify caching parameters.

Chapter 592

Page 93: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Processing templates with the Online GeneratorBefore deploying templates, you should author and test movies within Flash. Remember to modify data source references to relative paths if their locations are not identical to the paths used during authoring. Relative paths make the template’s location more flexible.

FTP clients should transfer movies and template files using the BINARY mode setting. You should set clients that have automatic options (such as Fetch on the Macintosh) to BINARY. Files uploaded as TEXT will be translated during upload and are often corrupted during the process. Data sources and other external media files should be uploaded normally, using settings that will not alter or translate the data. (For example, you can upload Macintosh data sources as BINARY to preserve the MacRoman encoding of higher ASCII characters.)

Specifying parameters for the Online Generator

You can define variables for a template using parameters on a URL. Passing parameters on the URL is the fastest method to pass data to Generator because it does not need to access the server’s file system when processing the template. Use the following syntax to append the variables to the URL:

path/template_file.swt?var1=String1&var2=String2

Here, var1 and var2 are the variable names and String1 and String2 are the values for the variables.

Note: For any special characters in variables, use standard URL escape codes (denoted by a percent sign (%) and a two-character hexadecimal symbol from the ISO-Latin-1 character set).

If you have the Enterprise Edition of Generator you can also specify cache and expire parameters for templates or files within a template on a URL. See “Using URL parameters to set caching preferences” on page 111 for complete information.

Processing Templates with Generator 93

Page 94: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Processing templates with the Offline Generator In Windows, the Offline Generator program can be started and run directly from the MS-DOS command line or from a batch or scripting environment such as an MS-DOS batch file or Perl script. In UNIX systems, the Offline Generator can be invoked from the command line in a shell or from a Perl script. Make sure that you run the Generate command from the Generator directory or set your system path to include the Generator directory. (In Windows NT, Generator is installed by default in C:\Program Files\Macromedia\Generator 2. In UNIX systems, where there is no default installation directory, Macromedia recommends that you use a directory in /usr/local, such as /usr/local/generator_2.)

You can use the Offline Generator in an online manner if you call it directly from a CGI script. For best performance, use the Online Generator if you need to create on-demand content.

Chapter 594

Page 95: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Setting Offline Generator optionsThe Offline Generator has several options (command-line switches) that modify the default operation of the program:

• -help Displays descriptions of Generator options.

• -swf <filename.swf> creates a Flash movie for output.

• -gif <filename.gif> creates a GIF image for output.

• -png <filename.png> creates a PNG image for output.

• -qtm <filename.mov> creates a QuickTime 4.0 movie for output.

• -jpg <filename.jpg> creates a JPEG image for output.

• -txt <filename.txt> creates a text file from all the text within the movie.

• -smap <filename.map> creates a server-side image map.

• -cmap <filename.map> creates a client-side image map.

• -cmapname <name> sets the client-side image map tag name.

• -xwin32 <filename.exe> creates a Win32 projector.

• -xmacppc <filename.hqx> creates a Mac PPC projector.

• -debug <1|2|3> specifies the level of detail you’d like displayed in the log file. 1 displays only errors in the log file; 2 displays errors and warnings; 3 displays errors, warnings, and all data sources. You can specify the name of the log file using the -log option.

• -log <filename.txt> specifies the log file name.

• -param <name> <value> specifies a named parameter.

Creating Flash movies

To generate a Flash movie, use the -swf option. The following command creates the Flash movie, movie.swf, from the template, movie.swt:

generate -swf movie.swf movie.swt

To send to standard output, which is useful when using CGI scripts, use the following command:

generate -swf - movie.swt

The second hyphen (-) indicates that the movie should be written not to file but to standard output.

Processing Templates with Generator 95

Page 96: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Creating GIF, JPEG, PNG, or QuickTime files

To create a GIF, JPEG, PNG, or QuickTime file, use the following syntax:

generate -xxx movie.xxx movie.swt

where xxx is the file extension (.gif, .jpg, .png, .mov).

Creating text in movies

If you want to collect all the text in a movie, you can create a text file. Later, you can read this file as you would any text file. For example, you can place the text as a comment in an HTML file. The comment can reference the movie from which the text came; then you can create search engines that index the text.

To create a text file containing the text in a movie, use the -txt option. The following command creates text:

generate -txt movie.txt movie.swt

Creating image maps

You can create client- and server-side image maps with the Offline Generator. A client-side image map is interpreted by the client browser and is included in the HTML that contains the GIF image. A server-side image map stays on the server; it is processed on the server using a special CGI script.

To create a server-side image map, use the -smap option. For example, the following command creates a server-side image map, movie.map, from movie.swt:

generate -smap movie.map movie.swt

To create a client-side image map, you must use both the -cmap and the -cmapname options. The -cmap option outputs a client-side image map; the -cmapname option sets the client-side image map tag name. When you create a client-side image map, you must specify an image map tag name. The following example creates a client-side image map, movie.map, with the tagname, mapname, from movie.swt:

generate -cmap movie.map -cmapname mapname movie.swt

You must include client-side image maps manually in the HTML code or process them with server-side includes.

Chapter 596

Page 97: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Creating projectors

You can create projectors for a variety of platforms, allowing users to double-click the movie to play it without Flash or any extensions.

To create a projector, use one of the following options:

• -xwin32 <filename.exe> creates a Win32 projector.

• -xmacppc <filename.hqx> creates a Mac PPC projector.

For example, the following command creates a projector for Windows 32-bit systems:

generate -xwin32 movie.exe movie.swt

Creating more than one file from a single call

You can generate more than one file type from a single call to Generator. For example, the following command creates both a Flash movie and a GIF file:

generate -swf movie.swf -gif movie.gif movie.swt

Specifying parameters

You can pass variables to a template using parameters with the -param option. For example, the following command passes String1 as the value for the var1 variable:

generate -swf Blimp.swf Blimp.swt -param var1 String1

Setting the debug message level

Generator displays messages as it processes template files. These messages list errors, warnings, and data sources encountered as the template is processed. You can specify the level of detail you’d like to track during processing.

To specify the level of detail contained in the log file, use the -debug option to specify up to three levels of detail:

• 1 logs all errors.

• 2 logs all errors and warnings.

• 3 logs all errors, warnings, and data sources.

The following command creates the Flash movie, movie.swf, from movie.swt and displays all errors, warnings, and data sources encountered by Generator when the template was processed.

generate -swf movie.swf -debug 3 movie.swt

Processing Templates with Generator 97

Page 98: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Creating a log file

You can create a log file containing information about how the template was processed. To create the log file, use the -log option.

The following command creates from movie.swt the Flash movie, movie.swf, and the log file, logfile.txt. The log file contains all errors, warnings, and data sources encountered by Generator when the template was processed.

generate -swf movie.swf -log logfile.txt -debug 3 movie.swt

Referencing generated content from a Web page

The output from the Offline Generator is a standard Flash player movie, GIF, JPEG, or PNG file. Therefore, the OBJECT, EMBED, or IMG tags used to reference the content are no different from tags used to reference standard Flash player movie files or GIF images.

Placing Generator content on the serverAfter you create a Generator template, transfer the template file along with any associated data files to the Web server that has an installed copy of Generator. You should place any external font files that were created when exporting a template in the same location as the template file.

Data source files should be transferred as BINARY when using FTP to move them between machines with different localized operating systems. Some FTP clients examine files and translate between encoding systems when transferring files using TEXT mode. This translation can yield undesirable results and corrupt the data source on the target system.

After you transfer the template files and if you’re using the Offline Generator, you can start the Offline Generator specifying where the output file should be placed. This location is typically within the root directory hierarchy of the Web server. For example, in Windows NT the following command places Blimp.swf in the root Web directory:

generate -swf c:\inetpub\wwwroot\Blimp.swf Blimp.swt

On UNIX systems, the command would be as follows:

generate -swf /etc/apache/htdocs/Blimp.swf Blimp.swt

Chapter 598

Page 99: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

6

CHAPTER 6

Setting Administration and

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Caching Properties

You can change the default configuration settings for your Generator system using the Administration Servlet (Enterprise Edition only) or by editing the generator.properties file (Developer and Enterprise Edition) and restarting Generator. You do not need to restart Generator if you use the Administration Servlet to make changes. The default settings for all properties are listed in the “Generator properties table” on page 115. This chapter contains information for both methods of administering Generator.

99

Page 100: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Editing the generator.properties fileThe generator.properties file is located in the properties folder at the root of the Generator installation folder. Developer Edition users must add entries to the generator.properties file and restart Generator to change the default Generator configuration settings. Enterprise Edition users are encouraged to use the Administration Servlet to change the default Generator configuration settings (see “Administration Servlet and caching feature (Enterprise Edition only)” on page 100 for more information).

To edit the generator.properties file, follow the instructions in this section along with the information in “Configuring the Servlet Properties panel” on page 104, and “Generator properties table” on page 115. You must restart Generator each time you edit the generator. properties file.

To edit the generator.properties file:

1 Open the generator.properties file in a text editor.

2 Using the information in “Generator properties table” on page 115, enter the property you want to change, specifying the new setting. For example, to change the default loggingLevel property setting from 1 to 3, add the following line to the generator.properties file:

com.macromedia.generator.loggingLevel=3

3 Once you have entered all of your changes in the generator.properties file, and saved your changes, restart Generator. If you do not restart Generator, your changes will not take effect.

Administration Servlet and caching feature (Enterprise Edition only)The Administration Servlet provides a user interface for setting administration and caching properties for Generator. It also displays information about your system and server, plus file statistics. This chapter discusses each panel of the Administration Servlet and explains how to enable and configure the caching feature. “Caching examples” on page 112 provides real-world caching scenarios demonstrating how to configure the caching feature according to the types of files in a template and according to how often items in a template file are updated. A reference table summarizing the correspondence between the generator.properties file and the Administration Servlet can be found at the end of the chapter.

Chapter 6100

Page 101: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using the Administration Servlet (Enterprise Edition only)The Generator Enterprise Edition and a Web server supported by Generator must be installed and running in order to access the Administration Servlet. You can access the Administration Servlet from any Web browser that has access to the machine running Generator. This allows you the convenience of administering Generator from a remote location.

To use the Administration Servlet:

1 Start your Web server and Generator.

2 In your Web browser, enter http://localhost/servlet/GenAdminThe Administration Servlet Logon page is displayed.

3 The first time you log in, enter Admin for the user name and your Generator installation serial number for the password.

Note: If you use the copy and paste method to enter your serial number, select only the serial number itself without selecting any extra spaces on the end. If you paste extra white space along with your serial number, you will receive an Invalid Logon message.

4 Click Logon.

The Information panel is displayed. You have now successfully entered the Administration Servlet.

5 To create a permanent user name and password, click the Admin button on the left to access the Administrator panel.

6 Use the fields on the Administrator panel to create a user name and password.

If you forget your login name or password, you can find them in the generator.properties file located in the properties folder at the root level of the Generator installation folder. They are listed in the following lines:

com.macromedia.generator.adminPassword=com.macromedia.generator.adminUserName=

7 Click Apply.

The next time you log in to the Administration Servlet, use your new user name and password.

Setting Administration and Caching Properties 101

Page 102: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

8 Review system, server, and Generator statistics in the following panels:

• Information displays the Generator serial number, the Generator installation path, and the time you launched Generator in conjunction with your Web server. The information displayed in the Generator Statistics panel is derived from this time. Stopping and restarting Generator will update this time and reset the values on all Generator Statistics panels to 0.

• Server Environment displays the port number used by the Web server, information about the name of the servlet engine currently running Generator, the name of the operating system Generator is running on, the version of JRE (Java Runtime Environment) being used by Generator, and the current number of concurrent threads (requests) being processed by Generator. Click your browser’s Refresh button to view current thread count information.

• Generator Statistics displays information about each file type supported by Generator (Flash, GIF, JPEG, PNG, and QuickTime). This includes the number of requests served for files of this type, the average size (in kilobytes) of the requested files, the largest file of this type served, the average amount of time in milliseconds it took Generator to process requests for this file type, and the longest amount of time it took in milliseconds for Generator to process a request for a file of this type. Clicking the Report button on any Generator Statistics panel opens a new browser window displaying the Generator Transaction Report. See “Generating a Transaction Report (Enterprise Edition only)” on page 103 for more information.

• Servlet Properties and Cache Settings are configuration panels used to set administration and caching properties as described in the following sections.

Chapter 6102

Page 103: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Generating a Transaction Report (Enterprise Edition only)The Generator Transaction Report is an HTML document containing a File Statistics table summarizing the information contained in the Generator Statistics panels for all file types (described in the previous section), and a 30 Day Transaction Reports table containing information about the total number of transactions (requests) processed by Generator. Stopping and restarting Generator does not affect the information in the transaction table but will reset the file type statistics to zero.

The 30 Day Transactions Reports table contains information about the number of transactions (requests) processed by Generator, including the average and peak number of requests, average response time, and number of days the server has been continuously running. The information is displayed for three consecutive 30-day periods, with the most recent 30-day period listed first.

You can generate a report for any 90-day period from the time you installed Generator to the present. Clicking the Report button on the Statistics panel generates a Transaction Report that includes the current day and the preceding 89 days. You can generate a Transaction Report for specific 90-day periods using the following instructions.

To generate a Transaction Report for a specific 90-day period:

1 Calculate the number of days between the current date and the last day (chronologically) of the period for which you are generating a report. For example, if today is January 30, and you wish to generate a report for the last 90 days of the previous year, the number of days is 30. Use this number to specify daysBack in step 3.

2 Open a Web browser and enter the URL used to access the Administration Servlet for your system:

http://localhost/servlet/GenAdmin

3 Append the URL with the following information, where daysBack equals the number of days calculated in step 1.

?adminCall=callStatisitics&daysBack=30The final URL should resemble the following:

http://localhost/servlet/GenAdmin?adminCall=callStatistics&daysBack=30

4 Press enter to begin generating the Transaction Report. Generating the report may take a few minutes; please be patient and do not attempt to interrupt the process.

5 Use your Web browser’s Save and Print commands to save copies of the Transaction Report for your records.

Setting Administration and Caching Properties 103

Page 104: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Configuring the Servlet Properties panelThe information in this section can be used by Developer Edition users to edit the generator.properties file and by Enterprise Edition users to configure the Servlet Properties panel. The properties listed in this section determine how Generator processes requests for information and should be set or changed only by someone who has an understanding of the capabilities of the Web server and files accessed by Generator.

Logging Level sets the Generator logging level and determines the level of errors recorded in the generator.log file located in the logs directory at the root level of the Generator program folder. Valid values are 0 (off ), 1 (errors), 2 (warnings), and 3 (verbose). In a live (as opposed to testing) environment it is recommended that you turn Logging Level to off (0) or use a setting no greater than 1 to conserve system resources and hard disk space. Cache logging is set on the Global Cache Settings panel (see “Global Cache Settings panel” on page 110).

Max Threads is the maximum number of simultaneous requests that Generator will process. Your servlet engine and Web server may also have configuration options for controlling the number of requests sent to Generator, and those settings may override the Max Threads setting. The number you enter here should directly correspond to the capabilities of your Web server and the amount of traffic your Web server handles. Setting Max Threads too low may cause visitors to receive a 503 or Service Unavailable message when accessing your site. Alternately, setting Max Threads to a level that exceeds the capabilities of your Web server will result in a slow request response time.

Note: The Max Threads property is set to 1 for the Developer Edition and cannot be changed by adding a new entry to the generator.properties file. To avoid requests being returned with a Service Unavailable message, make sure the queueSize (Developer Edition only) and requestTimeOut property settings are configured to handle additional requests.

External Font Location specifies the folder where your fonts are stored. The path to the fonts folder at the root level of the Generator program directory is entered by default. It is recommended that you place the fonts used by your templates in this folder rather than in the directory for each template. Alternately, you could create a common fonts folder in another location and enter the path here. Storing all your fonts in one folder saves disk space and enables Generator to process requests more quickly.

Default Symbol File specifies the file that contains symbols used for labeling charts and tables. If this field is left blank, Generator will default to the DefaultSymbolFile.swt file in the bin folder at the root level of the Generator program folder.

User Class Path specifies the folder where your Java data source classes are stored. If this field is left blank, Generator will default to the classes directory at the root level of the Generator application folder.

Chapter 6104

Page 105: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Request Time Out specifies the amount of time in milliseconds requests over Max Threads will wait before being returned a Service Unavailable message. For example, if you set Max Threads to 5 and six requests are made simultaneously, one of the six requests will be put on hold for the amount of time you enter here. If the other requests are processed within that time, the sixth request will be processed. If the server remains busy, the request will time out and not be processed.

Garbage Collect After Job Count (properties file only) specifies the number of transactions Generator will process before forcing the Java Virtual Machine to free memory by forcing garbage collection. This property cannot be set in the Administration Servlet, you must edit the generator.properties file using the information in the “Generator properties table” on page 115.

Caching (Enterprise Edition only)The Generator Enterprise Edition has a caching feature that allows content to be processed, saved in a disk or memory cache, and then served repeatedly, without having to be fetched or processed again. Enabling and configuring the Generator caching feature for your system reduces the load on your Web server, reduces response time, and allows you to configure automatic updates of data using the Expire After setting. For example, a site with daily specials could set Expire After at every 24 hours.

The manner in which you configure the caching feature depends on the capabilities of your Web server, the amount of hard disk space and memory your system has, and the types of files you are processing. The Generator caching feature is a powerful tool that can potentially automate the process of updating your site. However, caching may increase the danger of serving stale or out-of-date data if you do not set the expiration date for templates containing dynamic data. To avoid this problem, set a default expiration date using the Expire After option on the Global Cache Settings panel, which will apply to all templates, even those for which no expiration time has been set.

Setting Administration and Caching Properties 105

Page 106: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

How Generator caching works

The Generator Enterprise Edition caching feature uses three memory caches (request, media, and font) and one disk cache (file). Each cache is enabled and configured independently of the others, but they all work together in a hierarchical manner (depending on the configuration you choose) to process requests. The settings on the Global Cache Settings panel apply to all of the caches. The diagram below illustrates how Generator will process and serve templates depending on whether each cache is enabled or not enabled, and whether the requested data is in the cache or must be fetched from the source.

GENERATOR

WEB SERVER

Off ornot found

Incomingrequest

Reply .swf,.gif, .jpg,

.png, .movOn andfound

Process Template

Checkfile

cache

Fetchmedia

Fetchfont

Off ornot found

On andfound

Reply .swf,.gif, .jpg,

.png, .mov

Checkmediacache

Off ornot found

On andfound

Insertmediaobject

Checkfont

cache

Off ornot found

On andfound

Externalfontused

Checkrequestcache

Yes

No

Yes

No

Chapter 6106

Page 107: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Generator Processing without caching

If the caching feature is not enabled (Max Size is set to 0 for all caches), Generator loads the requested template, processes it, fetching the necessary external files, and creates and returns the resulting SWF, JPG, GIF, PNG, or QuickTime movie file. In this scenario each separate request requires that the template be processed, even if it is the same exact template and uses the exact same files. This is the most system-intensive and inefficient cache setting.

Generator processing with request caching enabled

If request caching is enabled, any template that has previously been processed is saved in the request cache and can be served again without further processing. If the requested template is not in the request cache, Generator will attempt to process the template using the font, media, and file caches if they are enabled. You can set up automatic updates of dynamic data using the Expires After setting on the Request Cache Settings panel.

Generator processing with font caching enabled

If font caching is enabled, any external font files (FFT) that have been previously requested are stored in the font cache and can be used to process subsequent template requests. If the requested font is not in the memory cache or if font caching has not been enabled, Generator will check in the directory where the template file is stored, or in the external font directory. See “Configuring the Servlet Properties panel” on page 104 for more information.

Generator processing with media and file caching enabled

Media files can be cached in the media cache (memory), and in the file cache (disk). The fastest cache is the media cache, with the file cache acting primarily as a backup. If media and file caching are both enabled, Generator will first check the media cache, and then check the file cache if necessary. Only if the files are not in either cache will they be fetched from disk, whether on a local or an external network (the source as specified in the URL of the template file). Like request and font caching, media and file caching reduce both the load to the server and server response time.

Generator processing with all caches enabled

If the request, font, media, and file caches are all enabled, Generator will first check the request cache. If the template is in the request cache, it is served without further processing. If the template is not in the request cache, Generator will process the template, searching the font, media, and file caches for the necessary files. If some of the files are not available in any of these caches, Generator will process the request using a combination of cached and fetched files.

Setting Administration and Caching Properties 107

Page 108: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Enabling and configuring Generator cachingThe Generator Enterprise Edition Caching feature is off by default (Max Size set to 0). To fully enable and configure a Generator cache, you need to set the parameters for the cache using the Cache Settings panel for that particular cache (request, font, media, and file), and set the global cache parameters on the Global Cache Settings panel. You have the option of enabling one or more of the caches at any time. Additionally, you can set caching for individual files by adding the necessary parameters to the URL used to call the files, or in the Flash authoring environment using the cache parameter that appears in the Generator panel for the Insert Movie, Symbol, GIF, JPEG, PNG, and MP3 objects.

You enable and configure caching using the Administration Servlet interface. Using the information below, enter the desired parameters for each type of caching you wish to enable. Each cache must be configured separately using the appropriate panel. You can also enable and configure Generator caching by editing the generator.properties file. See “Generator properties table” on page 115 for definitions and example inputs for each entry.

Chapter 6108

Page 109: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Request, Font, Media, and File Cache Settings panels

The information entered in the Request, Font, and Media Cache Settings panels applies to each individual memory cache. The information entered in the File Cache Settings panel applies to the disk cache, which contains only media files.

Click Apply before exiting each panel.

Max Size sets the size of the cache in kilobytes (K). You must enter a value in this field to turn on the cache (Request, Font, Media, and File Cache Settings panels). If this field is left blank or set to 0, the cache is not enabled (off ). When setting Max Size for each cache, take into account the total amount of memory you are allocating for caching (request+font+media), as well as the amount of memory used by the Web server and other applications running on the machine. Problems such as continuous disk read operations can arise if the Max Size of the cache is set larger than the system can handle.

Recycle operates using the principle FIFO (First In, First Out). Enter True to recycle cache space by deleting the oldest cache entries to make room for new entries. Enter False to save all cache entries until the Max Size is reached. Once Max Size is reached, the cache will not accept new entries.

Expire After specifies the amount of time (in seconds) entries will remain in the cache before they are considered expired and are deleted, if no other time is specified in the URL. See “Using URL parameters to set caching preferences” on page 111 for more information.

Cache Force can be set for all caches. Enter True to automatically cache all requests, regardless of the cache settings parameters specified in the URL. Enter False to disable this feature and select templates and files for caching on an individual basis by specifying the cache parameter in the URL or by setting the cache parameter in the Generator panel where it is offered as an option. The two valid cache parameters that can be used with Generator are the request cache parameter grc=true/false, and the media cache parameter gmc=true/false. See “Using URL parameters to set caching preferences” on page 111 for more information.

Check Modified can be set for font, media, and file caches. Enter True if Generator should check for a newer version of a file before serving the cached file. Enter False if Generator should use the file (if it exists) in the cache if it has not expired. Setting this option to True automatically updates and resets the cache every time you update your files.

Use Index File can be set only for file caching. Enter True to re-create the file cache on disk at startup. Enter False to clean out the cache directory and create a new file cache on disk each time Generator is restarted.

Setting Administration and Caching Properties 109

Page 110: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Global Cache Settings panel

The information entered in the Global Cache Settings panel applies to all the caches.

Click Apply before exiting the Global Cache Settings panel.

Logging Level determines the amount of information that is written to the cache.log file in the logs folder at the root of the Generator installation folder. Valid values include 0 (off ), 1 (errors), 2 (warning), 3 (verbose), 4 (debug information) and 5 (more detailed debug information). Setting the log level to 4 or 5 is not recommended in a production environment.

Log Cycle sets the amount of time (in minutes) you wish the cache.log file to cover. By default this is set to 0.

Max Cycled Logs sets the maximum number of cache.log files that will be generated. Once the maximum number of files has been created, the oldest log file is deleted to make room for the most current log file. This setting works in conjunction with the Log Cycle setting to determine how much logging information is recorded and how much space is used to store log files. Depending on the settings you choose, you can have several large files generated with short log cycles, or fewer files, each with a relatively longer log cycle.

Flush deletes all cached files. Use this button to reset the cache without restarting Generator.

Log Hits writes the hit counts for all cached items to the cache.log file. All of the hits that have been logged since Generator was started will be counted, allowing you to track how often each cached item is requested. This feature is independent of the cache logging feature.

Using the Cache property in the Generator panel

You can set the Cache property using the Generator panel (in the Flash authoring environment) for Generator objects that insert files (SWF, GIF, JPEG, PNG, and MP3). Setting this parameter to True activates caching for this object if caching is turned on, and if the URL parameter for the file is not set to False (gmc=false). The Cache property setting in the Generator panel is overridden by the settings specified for the individual caches in the Administration Servlet and by any cache parameters specified in the URL for a file or template. For example, if Force Cache is set to True, or if the URL for the file specifies gmc=true, the file will be cached even if the Cache parameter in the Generator panel is set to False.

Chapter 6110

Page 111: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Using URL parameters to set caching preferences

If you want, you can specify whether a template or media file is cached and when it expires, by setting the correct parameters in the URL. You can specify whether output from a template (SWT) file or individual object is cached and when it expires, using Generator cache and expire URL parameters.

Cache parameters can be set for the request cache, grc=true/false, and the media cache, gmc=true/false. Request cache parameters are used in the URL for template (SWT) files, and media parameters are used in the URL for the individual object. You can also use the Cache parameter in the Generator panel to set the media cache parameter, but setting a media cache parameter in the URL will override the Generator panel setting.

If you set Force Cache to True, all of the templates and media files used by Generator will be cached, regardless of the parameter specified in the URL. If you set Force Cache to False, only templates and files that specify gmc=true or grc=true in the URL will be cached. URL parameters override the Cache property setting in the Generator panel.

Expire parameters can be set for the request cache, gre=true/false, and the media cache, gme=true/false. As with the cache parameters, use request parameters for template files (SWT) and media parameters for Generator objects.

If you choose not to specify an expiration time in the URL, the Expire After time set on the Cache Settings panel for the cache (request, media, or font) that applies to the file type will determine when the cached file expires.

Review the information in the following “Caching examples” section for example scenarios of setting caching preferences using both the settings on the Cache Settings panels and the URL cache parameters.

Setting Administration and Caching Properties 111

Page 112: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Caching examplesThe examples in this section show how to use the cache panels in the Administration Servlet (Enterprise Edition only) in conjunction with URL caching parameters to set up caching according to how often the various elements in a template are updated.

The example template file is an ad displaying an assortment of products for a company and contains the following template items:

Background image created using the Insert GIF Generator object. The background image does not change.

Product image created using the Insert JPEG Generator object, which is dynamically updated.

Product description using an external font file, which is updated along with the product image.

Product update every 5 seconds

The background image is cached in the media cache without an expiration setting, since it is not updated. The product image is not cached, since it is dynamically updated every five seconds. The external font file used for the product description is cached in the font cache, because although the text is dynamic, the font remains the same. The template file for the ad is not cached in the request cache, because the product image and text are updated so frequently.

The following are the file names of the inserted files and the HTML of the template file:

Insert GIF: http://<yourserver>/static_image.gif?gmc=true

Insert JPEG: http://<yourserver>/dynamic_image.jpeg

Template file: <a href=”foo_template.swt”</a>

Template item Request Media File Font URL cache parameter

Cache force

Insert GIF n/a Yes Yes or No

n/a gmc=true False

Insert JPEG n/a No No n/a no cache parameter

False

External font file n/a n/a n/a Yes n/a True

Template file holding all items

No n/a n/a n/a n/a False

Chapter 6112

Page 113: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Product update every 10 minutes

The template file is the same as when the product update takes place every 5 minutes, but the products change less frequently. When files are updated less frequently, there are more caching options to consider for a given template file.

Option A

In this scenario, the cache settings remain the same for all of the elements except the product image, which is cached in the media cache with an expiration setting of 10 minutes.

The following are the file names of the inserted files and the HTML of the template file:

Insert GIF: http://<yourserver>/static_image.gif?gmc=true

Insert JPEG: http://<yourserver>/dynamic_image.jpeg?gmc=true&gme=600

Template file: <a href=”foo_template.swt”</a>

Template item Request Media File Font URL parameter

Cache force

Insert GIF n/a Yes Yes or No

n/a gmc=true False

Insert JPEG n/a Yes Yes or No

n/a gmc=truegme=600

False

External font file n/a n/a n/a Yes n/a True

Template file holding all items

No n/a n/a n/a n/a False

Setting Administration and Caching Properties 113

Page 114: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Option B

A more efficient alternative is to cache the entire template file in the request cache with an expiration setting of 10 minutes.

The following are the file names of the inserted files and the HTML of the template file:

Insert GIF: http://<yourserver>/static_image.gif?gmc=true

Insert JPEG: http://<yourserver>/dynamic_image.jpeg

Template file: <a href=”foo_template.swt?gre=true&grc=600”</a>

Template item Request Media File Font URL parameter

Cache force

Insert GIF n/a Yes Yes or No

n/a gmc=true False

Insert JPEG n/a No No n/a no cache parameter

False

External font file n/a n/a n/a Yes n/a True

Template file holding all items

Yes n/a n/a n/a grc=truegre=600

False

Chapter 6114

Page 115: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Generator properties tableThe following table lists the possible entries in the generator.properties file and their corresponding option in the Administration Servlet (Enterprise Edition only). All properties are available to both editions except where noted. The queueSize property is available only for the Developer Edition. Properties listed in sections marked (Enterprise Edition only) cannot be added to the generator.properties file for the Developer Edition. The properties are listed giving their default value. See “Editing the generator.properties file” on page 100 for more information about how to edit the generator.properties file.

generator.properties (including default value) Administration Servlet setting

Input Value

Servlet Properties panel

com.macromedia.generator.loggingLevel=1

Logging Level Integer 0 — 3

com.macromedia.generator.maxThreads=20Note: This property is set to 1 for the Developer Edition and cannot be changed.

Max Threads Integer > = 1

com.macromedia.generator.fontPath=C:\\ProgramFiles\\Macromedia\\Generator\\2\\classes

External Font Location

Directory path

com.macromedia.generator.defaultSymbolFile=C:\ProgramFiles\\Macromedia\\Generator\\2\\bin\\DefaultSymbolFile.swt

Default Symbol File

File path

com.macromedia.generator.userClassPath=C:\\ProgramFiles\\Macromedia\\Generator\\2\\classes

User Class Path Directory path

com.macromedia.generator.requestTimeout=1000

Request Time-out

Milliseconds

com.macromedia.genertor.queueSize=10 (Developer Edition only)

NA Integer > = 1

Request Cache Settings panel (Enterprise Edition only)

com.macromedia.generator.requestCacheMaxSize=0 Max Size KB > = 0

com.macromedia.generator.requestCacheRecycle=true

Recycle True/False

com.macromedia.generator.requestCacheDefaultExpire=0

Expiration Seconds > = 0

com.macromedia.generator.requestCacheForce=false

Force True/False

Setting Administration and Caching Properties 115

Page 116: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Font Cache Settings panel (Enterprise Edition only)

com.macromedia.generator.fontCacheMaxSize=0

Max Size KB > = 0

com.macromedia.generator.fontCacheRecycle=true

Recycle True/False

com.macromedia.generator.fontCacheDefaultExpire=0

Expiration Seconds > = 0

com.macromedia.generator.fontCacheForce=false

Force True/False

com.macromedia.generator.fontCacheCheckModifiedSince=true

Check Modified True/False

Media Cache Settings panel (Enterprise Edition only)

com.macromedia.generator.mediaCacheMaxSize=0

Max Size KB > = 0

com.macromedia.generator.mediaCacheRecycle=true

Recycle True/False

com.macromedia.generator.mediaCacheDefaultExpire=0

Expiration Seconds > = 0

com.macromedia.generator.mediaCacheForce=false

Force True/False

com.macromedia.generator.mediaCacheCheckModifiedSince=true

Check Modified True/False

File Cache Settings panel (Enterprise Edition only)

com.macromedia.generator.fileCacheMaxSize=0

Max Size KB > = 0

com.macromedia.generator.fileCacheRecycle=true

Recycle True/False

com.macromedia.generator.fileCacheDefaultExpire=0

Expiration Seconds > = 0

com.macromedia.generator.fileCacheForce=false

Force True/False

com.macromedia.generator.fileCacheCheckModifiedSince=true

Check Modified True/False

generator.properties (including default value) Administration Servlet setting

Input Value

Chapter 6116

Page 117: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

com.macromedia.generator.fileCacheLoadIndex=false

Use Index File True/False

Global Cache Settings panel (Enterprise Edition only)

com.macromedia.generator.cacheLoggingLevel=0

Logging Level Integer 1-5

com.macromedia.generator.cacheLogCycle=0

Log Cycle Seconds > = 0

com.macromedia.generator.cacheLogMaxFiles=10

Max Cycled Logs

Integer > = 0

Administrator panel (Enterprise Edition only)

com.macromedia.generator.adminUserName=Admin

Login Name String

com.macromedia.generator.adminPassword=your Generator installation serial number

Password String

Properties file only (cannot be set in AdminServlet)

com.macromedia.generator.garbageCollectAfterJobCount=0

None Integer 0 - 2000

generator.properties (including default value) Administration Servlet setting

Input Value

Setting Administration and Caching Properties 117

Page 118: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Chapter 6118

Page 119: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

A

APPENDIX A

Data Source Summary for

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Generator Objects

Data source summary for Generator objectsWhen creating data sources for Generator objects, it is important to remember that there are required and optional columns specific to each Generator object. Additional columns can be specified, by referencing variables of the same name inside the Text symbol or other symbols in the SWT file, but the data source must also include the columns required by the object.

The information in the following table summarizes the data source information for all of the Generator objects, listing both the required and the optional columns for each object.

Generator object Required columns Optional columns

Line Chart Value: the relative height of a point in a chart

Hlabel: the label on the horizontal axisColor: the color of the lineNote: To specify multiple data sources for line or scatter charts, create a semicolon-delimited list of the data sources.

Area Chart Value: the relative height of a point in a chart

Hlabel: the label on the horizontal axis

119

Page 120: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Bar Chart Value: the relative height of a bar in the chart

Color: the color of the bar chartURL: any valid URL.Window: choose one: _self, _blank, _parent, _topHlabel: text for label on horizontal axisGoto: frame number in parent timelineGotolabel: label in the parent timelineNote: Adding URL, Goto, or Gotolabel makes the bar a button that takes the user to a specified location when it is clicked.

Stacked Bar Chart, Stacked Area Chart, or Stacked Line Chart

Color: the color of a bar in the chartValue: a series of columns, Value1, Value2, Value3, and so on

Scatter Chart and Scatter Line Chart

X: the X position of a point on the chartY: the Y position of a point on the chartClip: required if using the Plot command

Symbol: a symbol containing formatting for the plotted points. If a symbol is not specified, the points are plotted with dots.Color: used for the system default shapeHlabel: defines the text for the label on the horizontal axis.Optional for Plot command:X-scale: the X-scale of the movie clipY-scale: the Y-scale of the movie clipRotate: rotation of the movie clip

Stock Chart Open: the open valueClose: the close valueHigh: the high valueLow: the low value

Hlabel: the text for labels on the horizontal axis

Generator object Required columns Optional columns

Appendix A120

Page 121: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Pie Chart Value: the size of the pie slice in the chart Color: the color of the pie slice

URL: any valid URLWindow: choose one: _self, _blank, _parent, _topGoto: frame number in the parent timelineGotolabel: frame label in the parent timelineNote: Adding URL, Goto, or Gotolabel makes the pie slice a button that takes the user to a specified location when it is clicked.

Plot Clip: the name of the symbol to insert from the libraryX: an integer value representing the horizontal position of the symbol’s center point relative to the upper left corner of the Plot area (bounding box).Y: an integer value representing the vertical position of the symbol’s center point relative to the upper left corner of the Plot area (bounding box).

X-scale: a decimal scale factor to be applied to the horizontal scale of the symbol.Y-scale: a decimal scale factor to be applied to the vertical scale of the symbol.Valid values for both X- and Y- scale are 0.0 - 10.0 where 1.0 represents no change in scaling.Rotation: a decimal value specifying the angle of rotation applied to the symbol. Rotation is around the center point. Negative numbers rotate the symbol to the left, positive numbers, to the right.

List, Scrolling List, and Ticker

Clip: the name of the symbol to be inserted into the list. The list contains as many items as there are rows in the data source.

Multipage List Text: the text for the list element Symbol: a symbol containing a graphic for a list element, or special text formatting for list elementsURL: any valid URLWindow: choose one: _self, _blank, _parent, _top. Default value is _self.Note: Adding URL makes the list element a link that takes the user to a specified location when it is clicked.

Generator object Required columns Optional columns

Data Source Summary for Generator Objects 121

Page 122: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Radio Button Text: the text to appear next to each radio button. One radio button is created for each row in the data source.

Variable: columns having the same name as variables inside symbol files. There should be one column for each variable to replace.

Table Clip: the name of the symbol to be inserted in the table. This must be the first column in the data source.

Variable: columns having the same name as variables inside symbol files. There should be one column for each variable to replace.

Generator object Required columns Optional columns

Appendix A122

Page 123: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

INDEX

A

actionsplacing actions inside Generator object 28targeting Generator objects 27

Administering Generator 99Administration Servlet 14, 99, 100

Administrator panel 101caching 105creating and changing password 101Default Symbol File setting 104External Font Location setting 104File Cache Settings panel 109Font Cache Settings panel 109Generator Statistics panel 102Global Cache Settings panel 110Information panel 102launching 101Logging Level setting 104logging on 101Max Threads setting 104Media Cache Settings panel 109panels, setting options 109Properties table 115remote administration 101Report button (Statistics panel) 103Request Cache Settings panel 109Request Time Out setting 105Server Environment panel 102Servlet Properties panel 102, 104User Class Path setting 104

B

Bar Chart objectData Source property 44See also Basic Chart Object

Basic Chart object 433D Depth property 44Border property 46Border Thickness property 46Chart Type property 44Color property 46Data Source property 44External Symbol File property 45Gap property 44Grid Lines property 45Grid Scales property 45Horizontal Label Orientation property 45Horizontal Label Scale property 45Instance Name property 47Label Format property 44Labels property 44Line Thickness property 46Major/Minor Grid Lines properties 45Max Data Entries property 44Max Y-Pos property 46Max Y-Pos Type property 46Min Y-Pos property 46Min Y-Pos Type property 46Origin property 46Plot Symbol property 44Value Display property 45Value Format property 45Value Placement 45Value Scale property 45

buttonsin templates 29See also Radio Button objectwith actions 29

123

Page 124: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

C

caching 105Cache Force setting 109Cache property in Generator

panel 33, 35, 36, 110cache size (Max Size) 109Check Modified setting 109diagram 106enabling and configuring 108Expire After setting 109file cache 107File Cache Settings panel 109Flush button 110font cache 107Font Cache Settings panel 109Generator objects 31Global Cache Settings panel 110Log Cycle setting 110Log Hits setting 110Logging Level setting 110Max Cycled Logs setting 110Max Size setting 109media cache 107Media Cache Settings panel 109processing with all caches enabled 107real-world examples 112Recycle setting 109request cache 107Request Cache Settings panel 109turning cache on/off 109URL cache parameters 111Use Index File setting 109

Caching feature 100

D

data sourcecolumn name/value format 68cross-platform sources 82data source dialog box using # sign 72data source encoding 82Data Source parameter field 71format 68Generator objects and commands, assigning to 74Generator parsing 71Java data sources 78JDBC/ODBC sources 75localized sources 82multiple sources in a template 83name/value format 68ODBC data source, assigning to templates 75Replicate command 58requirements 74sample Java data source class 79special characters 69specifying color in 70SQL statements 76template file, referenced in 82types of 67URL, HTTP, FTP, FILE, FGFTP

URL sources 77debugging and testing templates 89

Index124

Page 125: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

G

garbage collection 105Generator API/SDK 14Generator Environment Variable

button 68, 71Column Name/Value button 71command 73data source assigning 72Name/Value button 71setting variables using database query 71

Generator objectscaching 31Stage, placing on 22symbol, placing in 22target of actions 27

Generator Objects palette 21showing or hiding 21

Generator panel 21displaying 22

Generator Statistics panel, Administration Servlet 102Generator Support Center 17generator.properties file

corresponding panels in the Administration Servlet 115

garbageCollectAfterJobCount setting 105GIF files 96

H

HelpExtending Generator 16Generator Support Center 17guide to instructional media 16Online Help systems 17Using Generator 16

HTML syntax, processing templates with 91

I

Image Maps 96Insert GIF object 34

Frames property 35Insert GIF, JPEG, PNG object, Instance Name

property 35Insert JPEG object 34Insert JPEG, GIF, PNG objects

Cache property 35Export As property 34File Name property 34Generator panel properties 34JPEG Quality property 34Scale to Fit property 34

Insert Movie object 33Cache property 33Expand Frames property 33File Name property 33Generator panel properties 33Instance Name property 33, 36Scale to Fit property 33

Insert MP3 objectCache property 36Delay property 36File Name property 36Generator panel properties 36Instance Name property 36Stream property 36

Insert PNG object 34Insert Sound object 36

Generator panel properties 36Loop Count property 36Sound Symbol property 36

Insert Symbol object 32Generator panel properties 32instance name as action parameter 27Instance Name property 32Scale to Fit property 32Symbol Name property 32

installingGenerator 10JRun 11

Index 125

Page 126: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

J

JDBC data source 75JRun, installing 11

L

Line Chart objectdata source 43See also Basic Chart object

List object 37List, Scrolling List, Ticker objects

Alignment property 38Data Source property 37Generator panel properties 37Instance Name property 38Item Space property 38Mask to Box properties 37Orientation property 37Spacing property 38Step Size property 38

log file 98

M

movie clipdynamically modifying 55dynamically replacing 56

movies 95inserting 33

Multipage List object 38Data Source property 39External Symbol File property 40Generator panel properties 38Home Symbol property 39Instance Name property 40Items per Page property 39Line Spacing property 39Next Symbol property 39Previous Symbol property 39special variables 40Symbol Spacing property 39Text Symbol property 39

O

Objects palette 21ODBC data source 75Offline Generator

differences between Online and Offline 90Flash Movies 95options 95processing 19, 90templates 94

Online Generator 93processing 19, 90templates 93

Output window, debug level 89

P

Pie Chart object 48Border property 48Color property 48Data Source property 48Depth property 48External Symbol File property 48Generator panel properties 48Instance Name property 48Line Thickness property 48Value Display property 48Value Format property 48Value Position property 48

Plot command 42Border, Border Color, and Thickness

properties 42Data Source property 42Instance Name Column property 43Instance Name property 42Min/Max X-Pos properties 42Min/Max Y-Pos properties 42Rotate Column property 43Symbol Name Column property 43X Column property 42X-Scale Column property 42Y Column property 42Y-Scale Column property 43

PNG files 96

Index126

Page 127: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

processing templatesdebug level 97file cache 107font cache 107generated content from a Web page 98HTML syntax 91media cache 107Offline Generator 94Online Generator 93Online Generator and Offline options 90parameters 97placing content on the server 98previewing template 88Publish Settings 86request cache 107

projectors 97Publish Settings

Background 86changing and setting 86Create External Font Files 87Data Encoding 87External Media 87Format tab 89Frame Rate 86Height 86Load Order 86Parameters 87Width 86

Q

QuickTime files 96

R

Radio Button object 52Data Source property 52Generator panel properties 52Instance Name property 53Line Spacing property 52Off Symbol property 52On Symbol property 52Selected Button Variable 53Selected by Default property 53Text Symbol property 52

Replace command, movies clips and graphic symbols 56

Replicate command 57Data Source property 58movie clips and graphic symbols 59

S

Scatter Chart object, Data Source property 44Scrolling List object

Generator panel properties 37See also List object

Server Environment panel, Administration Servlet 102Servlet Properties panel, Administration

Servlet 102, 104set alpha channel 60Set Brightness command 61

movie clips and graphic symbols 61Set Color command

Offset Red, Green, Blue, and Alpha 62RGB color value 62

Set Custom Color 62graphic symbol 62guidelines for setting 64Percent Red, Green, Blue, and Alpha 62

Set Environment dialog box 68Set Tint command 61

movie clips and graphic symbols 61Set Transparency command 60Sound

inserting 36See also Insert Sound object, Insert MP3 object

Stacked Chart objectdata source 44See also Basic Chart object

Stock Chart object 49Border property 51Border Thickness property 51Chart Type property 49Close Column property 51Color property 51Data Source property 49External Symbol File property 51Gap property 49Generator panel properties 49Grid Lines property 50Grid Scales property 49High/Low Column property 51Horizontal Label Orientation property 49Horizontal Label Scale property 50Instance Name property 51Label/Value Format properties 51Labels property 49Line thickness property 51Major Grid Lines property 50

Index 127

Page 128: macromedia - evl · 2002. 2. 6. · Macromedia, Made with Macromedia Logo and Design, MAGIC Logo and Design, Mediamaker, Movie Critic, Multimedia is the Message, Object Authoring,

Stock Chart object (continued)Max Data Entries property 49Min/Max Y-Pos property 50Min/Max Y-Pos Type property 50Minor Grid Lines property 50Open Column property 51Start Offset property 49Value Display property 50Value Placement property 50Value Scale property 50Value to Display property 50

symbolsdynamic replacement 56identifying in the library 22inserting 32setting transparency 60

system requirements 9Macintosh 9UNIX 9Windows 95/98 9Windows NT 9

T

Table object 40Alignment property 41Border, Border Color, and Thickness

properties 41Data Source property 41Default Symbol property 41External Symbol File property 41Generator panel properties 41Instance Name property 41Label Format property 41Label Sizing property 41Row and Column Labels properties 41Rows and Columns properties 41Sizing property 41

templates, processingcaching and 107choosing online and offline 90creating 20debugging and testing 88exporting 89Flash Movies 95GIF, JPEG, QuickTime files 96image maps 96log file 98

templates, processing (continued)multiple files from a single call 97projectors 97text in movies 96

textcreating in movies 96dynamically replacing with variables 25

Ticker objectGenerator panel properties 37See also List object

Transaction Report 103Transform command 65

movie clip or graphic symbol 65Rotation parameter 65X and Y Offset properties 65X- and Y-Scale properties 65

U

uninstalling Generator 12upgrading 15uploading templates 98URL parameters for caching 111

V

variablescommand-line parameters 24concatenating 24creating and using 23creating for text replacement 25curly braces 24defining 24Multipage List object 40object properties or commands 25parameters for Flash actions 26replacing text 25Replicate command 57Selected Button Variable 53URL parameters 24

W

Web application server technologies 30Web server, transferring Generator files to 98

Index128