File compression strategy
Since SWF files are frequently delivered over a network connection, they should be as compact as possible. Several techniques are used to accomplish this, including the following items:
文件压缩策略
因为SWF文件经常是通过网络连接传递的,所以它们越紧凑越好。这几个技术是被用于实现这一点的,包括下面的几条:
Reuse—The structure of the character dictionar、y makes it easy to reuse elements in a SWF file. For example, a shape, button, sound, font, or bitmap can be stored in a file once and referenced many times.
复用-这个角色字典结构使得容易去复用SWF文件元素。例如,形状,按钮,声音,字体,或者图象能被一次存储在文件中并且多次引用。
Compression—Shapes are compressed by using an efficient delta encoding scheme; often the first coordinate of a line is assumed to be the last coordinate of the previous line. Distances are also often expressed relative to the last position.
压缩-形状是采用高效的偏差压缩编码方案;通常一条线的起始坐标假定是上条线的结束坐标。距离也常常表示相对于上一个位置。
Default values—Some structures, like matrixes and color transforms, have common fields that are used more often than others. For example, for a matrix, the most common field is the translation field. Scaling and rotation are less common. Therefore, if the scaling field is not present, it is assumed to be 100%. If the rotation field is not present, it is assumed that there is no rotation. This use of default values helps to minimize file sizes.
默认值-有一些结构,像matrixes and color transforms,有一些公用字段通常用得比其他的多。例如,marix,更多的通过字段是转换字段。缩放和旋转是很少通用的。因此,如果字段不存在,假定它是100%,如果这个旋转字段不存在,假定它是不旋转。这种默认用法帮助文件更小。
Change Encoding—As a rule, SWF files only store the changes between states. This is reflected in shape data structures and in the place-move-remove model that the display list uses.
改变编码-作为一种规则,SWF文件只存诸状态之前的变化。这是反映到形状数据结构和显示列表使用放置-移动-删除模块。
Shape Data Structure—The shape data structure uses a unique structure to minimize the size of shapes and to render anti-aliased shapes efficiently on the screen.
形状数据结构-这形状数据结构使用一个独特的结构以减少形状大小和有效的显示抗锯齿形状在屏幕上。
Summary
A SWF file is made up of a header, followed by a number of tags. The two types of tags are definition tags and control 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 file.
总结
一个SWF文件是由一个接着一个的标签号码头组成。两种类型的标签分别是定义型标签和控制型标签。定义型标签定义对象角色存储在字典里。控制型标签控制角色,并控制这个文件流程。
Since SWF files are frequently delivered over a network connection, they should be as compact as possible. Several techniques are used to accomplish this, including the following items:
文件压缩策略
因为SWF文件经常是通过网络连接传递的,所以它们越紧凑越好。这几个技术是被用于实现这一点的,包括下面的几条:
Reuse—The structure of the character dictionar、y makes it easy to reuse elements in a SWF file. For example, a shape, button, sound, font, or bitmap can be stored in a file once and referenced many times.
复用-这个角色字典结构使得容易去复用SWF文件元素。例如,形状,按钮,声音,字体,或者图象能被一次存储在文件中并且多次引用。
Compression—Shapes are compressed by using an efficient delta encoding scheme; often the first coordinate of a line is assumed to be the last coordinate of the previous line. Distances are also often expressed relative to the last position.
压缩-形状是采用高效的偏差压缩编码方案;通常一条线的起始坐标假定是上条线的结束坐标。距离也常常表示相对于上一个位置。
Default values—Some structures, like matrixes and color transforms, have common fields that are used more often than others. For example, for a matrix, the most common field is the translation field. Scaling and rotation are less common. Therefore, if the scaling field is not present, it is assumed to be 100%. If the rotation field is not present, it is assumed that there is no rotation. This use of default values helps to minimize file sizes.
默认值-有一些结构,像matrixes and color transforms,有一些公用字段通常用得比其他的多。例如,marix,更多的通过字段是转换字段。缩放和旋转是很少通用的。因此,如果字段不存在,假定它是100%,如果这个旋转字段不存在,假定它是不旋转。这种默认用法帮助文件更小。
Change Encoding—As a rule, SWF files only store the changes between states. This is reflected in shape data structures and in the place-move-remove model that the display list uses.
改变编码-作为一种规则,SWF文件只存诸状态之前的变化。这是反映到形状数据结构和显示列表使用放置-移动-删除模块。
Shape Data Structure—The shape data structure uses a unique structure to minimize the size of shapes and to render anti-aliased shapes efficiently on the screen.
形状数据结构-这形状数据结构使用一个独特的结构以减少形状大小和有效的显示抗锯齿形状在屏幕上。
Summary
A SWF file is made up of a header, followed by a number of tags. The two types of tags are definition tags and control 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 file.
总结
一个SWF文件是由一个接着一个的标签号码头组成。两种类型的标签分别是定义型标签和控制型标签。定义型标签定义对象角色存储在字典里。控制型标签控制角色,并控制这个文件流程。