An Overview of Data Representation - Flash

In our text replacement example, you learned that data can be represented in a text document (or as output from a server script or application) as name, value. With Generator variables and values, there are two methods of feeding data into Templates: Name/Value layout, and Column Name/Value layout.

Name/Value data
Specifying the variable’s name and its value on the same line of the text file or output represents this type of data. Similar to Flash 5’s URL-encoded variables, the variable’s name and value are declared side by side. The following URL form-encoded variables:


or the Flash 5 ActionScript equivalent:

would appear as:

in a Generator data source. This method of data representation is useful when you have nonrepeating variable names. If you had several firstName variables and lastName variables, then you would need to either number each variable (for example, firstName_1, firstName_2, and so on) or use a Column Name/Value data layout.

Column Name/Value data
The other type of data representation is Column Name/Value, in which the first text line describes the variable names, and each line of text thereafter becomes a unique instance with values. The line position and count determines the order and frequency of the data (respectively). You may have already guessed that this description sounds a lot like an Array Object in Flash 5.

The following Flash 5 Array Objects:

could be represented in Column Name/Value form as:

As you can see, Column Names enable you to quickly specify new values for the same data element. In the preceding example, we can very easily add new names to the Column Name/Value layout. Generator can use both types of data representation. Some objects, such asthe Chart Object, require the use of Column Name/Value layout. However, Generator text variables can use Name/Value layouts to dynamically insert data into Flash Text blocks and fields.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Flash Topics