• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 11. Adding Generator Content > Adding a Data Source

Adding a Data Source

Generator can use several data-source formats: a comma-delimited text file, a URL that references a comma-delimited text file, a result set from an SQL query passed through a JDBC/ODBC connection, a native data source, or a Java class. You can also use ASP, ColdFusion, PHP, Perl, and other programs to dynamically generate a comma-delimited text file that Generator can use. In the preceding exercise, you used a native data source to fill in the value of the {heading} and {caption} Generator variables. In this exercise, you will use an external text file to do the same thing.

1.
Click the Generator Environment Variable button in about2.fla. When the Set Environment dialog box opens, replace the existing text with mydata.txt, and click OK:

You can refer to an external text file in the Set Environment dialog box. Generator will use the external text file as the data source for the movie. In the next step, you'll create that data source.

2.
Open your favorite text editor (Notepad or SimpleText will do), and type the following in a new text document:

name, value

heading, “Business is Booming!”

caption, “Visitors are coming to our resorts in record numbers.”

This text should look almost exactly like the text that you entered in the Set Environment dialog box in the preceding exercise. The only difference is that it does not contain the pound-sign character (#).

3.
Save the text file as mydata.txt in the MyWork folder.

You have to save the text file in the same folder as the Generator template in this case, because you typed a relative path to the data source in the Set Environment dialog box.

4.
Return to about2.fla, and test the movie.

The movie should be identical to that which you saw the last time you tested it. The only difference is that the values for the Generator variables in the text box are being drawn from an external data source instead of a native one.

5.
Close the test movie, and save the file as about3.fla in the MyWork folder.

Inserting dynamic text is one of the awesome things that Generator can do. In the following exercise, you will add some more Generator content.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint