Providing data sources to Generator

You 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 # 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.

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 you can 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.


 
Assigning data sources to Generator objects and commands

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

Basic Chart
List
Pie Chart
Plot
Scrolling List
Stock Chart
Ticker
Table
Replicate

You should provide data sources for these objects and commands in Column Name/Value format.