AOL's Web Log

Life is like a box of chocolate , you never know what you gonna get .

原创 SWF文件格式说明书(四)收藏

新一篇: .net WinForm 控件的事件委托剖析 | 旧一篇: neoswiff编译器选项罗列

File Compression Strategy

文件压缩策略

Since SWF files are frequently delivered over a network connection, it is important that they be as

compact as possible. There are several techniques that are used to accomplish this. Here are some

things to look out for:

既然SWF文件在网络连接中传输得非常频繁,那它们当然是越紧凑越好。有很多技术可以实现这点。这是我们选中的几种有效的策略:

 

Reuse The structure of the character dictionary makes it very 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 using a very efficient delta encoding scheme, often the

first coordinate of a line is assumed to be the last coordinate of the previous one. Distances are

also often expressed relative to the last position.

压缩 形体使用了非常有效的差值编码方法来压缩,经常直线的开始坐标是上一条直线的最终坐标。距离经常由上一个位置的坐标来表达。

 

Default values Some structures like matrices 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.

默认值 有一些结构像矩阵和色彩变换都有一些共同的属性用得比其它的多。比如一个矩阵,最常用的属性就是平移属性,而缩放与旋转则用得相对少点。因此如果没有定义缩放属性,就假定它的值为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 used by the display list.

变化编码 作为一种规则,SWF文件只存储两种状态之间的变化。它由形体数据结构和播放列表中使用的定位/移动/移除模块反映出来。

 

 

Shape Data Structure The shape data structure uses a unique structure to minimize the size of

shapes and to render anti-aliased shapes very efficiently on the screen.

形体数据结构 形体数据结构使用了一种独特的结构,使得形体的文件大小最小化,并且使得形体在屏幕上的平滑抗锯齿处理非常有效。

 

Summary

小结

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

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 movie.

一个SWF文件是由一个文件头,跟着一系列的标签组成的。标签类型有两种:定义型标签和控制型标签。定义型标签把所有物体定义成一个个角色,这些角色存在字典里面。控制型标签操作这些角色,并且控制影片的流程。

发表于 @ 2005年06月03日 11:34:00|评论(loading...)|编辑

新一篇: .net WinForm 控件的事件委托剖析 | 旧一篇: neoswiff编译器选项罗列

评论

#Rio 发表于2005-08-07 15:35:00  IP: 61.186.252.*
谢谢!
#outiejun 发表于2005-08-23 16:52:00  IP: 211.100.4.*
关于swf规范和actionscript2语言规范.
请问如何获得这两种规范?我想深入了解,其中的内容,忘赐教。
#outiejun 发表于2005-08-23 16:53:00  IP: 211.100.4.*
关于swf规范和actionscript2语言规范.
请问如何获得这两种规范?我想深入了解,其中的内容,忘赐教。
#flash爱好者 发表于2006-07-06 20:47:00  IP: 218.15.112.*
请问手头上还有SWF文件格式文档吗?
#yoyo 发表于2006-07-19 17:58:00  IP: 218.94.94.*
我想下swf格式的文档,可是mm网站已经不行了,可以发一份给我吗?soseuqinchuan@gmail.com 谢谢了
发表评论  


当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
Csdn Blog version 3.1a
Copyright © AOL