Adobe Flash (SWF) Writer

The Adobe Flash® (SWF) writer provides FME with the ability to write Flash export files.

Flash is a movie creation and display application designed to deliver vector graphics and animation over the Internet.

Note: This format is available only in 32-bit FME installations.

Overview

Flash files are stored in compressed, binary, tag-formatted .swf files. The MIME type is application/x-shockwave-flash.

Flash files are compressed so they can be used as web content, but this means that file creation takes longer due to the extensive compression techniques that are employed. Writing the movie to the .swf file can take up to three times as long as processing the features. Processing the features themselves is also more time-consuming than with some other formats due to the conversions and formatting of features that takes place (see notes on particular features).

In addition, since Flash was not originally designed to handle maps or large numbers of features, performance declines according to the number of features. Therefore, in order to improve performance, we recommend that the features be generalized before being sent to the Flash writer.

A Flash movie may consist of several frames, however, the Flash Writer uses only one frame at a time to hold the converted image if the animate draw option is turned off; otherwise, each feature is stored in a frame and then they are displayed incrementally, which results in the map drawing itself bit by bit.

SWF File Structure

An SWF file is made up of a header, followed by a number of tags. There are two types of tags:

  • Definition tags define the objects known as characters, which are stored in the dictionary.
  • Control tags manipulate characters, and control the flow of the movie.

All tags share a common format, so any program parsing an SWF file can skip over blocks it does not understand. Tags can be removed, inserted, or modified by tools that process an SWF file.

The Flash writer will be primarily concerned with the definition tags for the shapes and will use the control tags for only simple movie flow control such as the begin and end tags, and placing the objects in the frames.

All Flash frames in a movie are contained in a single file with an .swf extension.

Filename Extension

Contents

.swf

All vector geometric data in movie frames

Shapes

Shape representation is similar to most vector formats in that shapes are defined by a list of edges called a path. A path may be closed (where the start and end of the path meet to close the figure), or open (where the path forms an open-ended stroke). A path may contain a mixture of straight edges, curved edges, and “pen up and move” commands. The latter allows multiple disconnected figures to be described by a single shape structure.

A fill style defines the appearance of an area enclosed by a path. Fill styles supported by SWF include a solid color or two gradient fills.

A line style defines the appearance of the outline of a path. The line style may be a stroke of any thickness and color.

Most vector formats only allow one fill and line style per path. SWF extends this concept by allowing each edge to have its own line and fill style. This can have unpredictable results when fill styles change in the middle of a path. Flash also supports two fill styles per edge, one for each side of the edge.

Note: This capability is not utilized by the Flash writer and all edges of a polygon or line will have the same line and fill styles.

Fonts and Text

Flash text is supported by FME but is represented as line segments, not as real text glyphs. This is for simplicity and because of incompatibility between the Hershey fonts used and the Flash glyph format.

Writer Overview

The Flash writer creates and writes feature data to an .swf file specified Dataset parameter.

If the folder contains an older .swf file, and it has the same file name, the older file will be overwritten with the new feature data.