SWF文件格式说明书--字典

类别:编程语言 点击:0 评论:0 推荐:

The Dictionary

字典

The dictionary is a repository of characters that have been defined, and are available for use by Control Tags. The process of building and using the dictionary is as follows: 1 A definition tag defines some content, such as a shape, font, bitmap, or sound. 2 A unique CharacterId is assigned to the content by the definition tag. 3 The content is saved in the dictionary under the CharacterId. 4 A control tag retrieves the content from the dictionary using the CharacterId, and performs some action on the content, such as displaying a shape, or playing a sound. Every definition tag must specify a unique ID. Duplicate IDs are not allowed. Typically, the first CharacterId is 1, the second CharacterId is 2, and so on. Character zero is special and considered a null character. Control tags are not the only tags that reference the dictionary. Definition tags can use characters from the dictionary to define more complex characters. For example, the DefineButton and DefineSprite tags refer to other characters to define their contents. The DefineText tag can refer to font characters to select different fonts for the text.

字典是已经定义好的所有角色的仓库,并且可以通过控制型标签来使用它。建立和使用字典的过程是以下这样的:1.一个定义型标签定义了一些内容,如形体,字体,位图或者声音。2.定义型标签给该内容赋上一个唯一的角色标识(CharacterID)。3.依据角色标识把内容存到字典中。4. 一个控制型标签根据角色标识从字典中找出相应的内容,然后给这个内容执行一些动作,比如显示一个形体,或者播放一个声音。每个控制型标签都只指定一个唯一的标识。相同的标识是不允许的。举个象征性的例子,第一个角色的标识是1,第二个角色的标识是2,依次类推。角色标识为0的是一个特殊的标识,被看作是空角色。控制型标签并不是唯一指向字典的标签。定义型标签也可以指向多个角色来定义一些更复杂的角色。例如,定义按钮(DefineButton)和定义精灵(DefineSprite)标签都是根据其它角色来定义它们的内容的。定义文字(DefineText)标签可以指向字体角色来为文字选择不同的字体。

附:Sprite一般都翻译为精灵,解释可以查相关的书籍,flash ,director等都有这个概念。

The following diagram illustrates a typical interaction between definition tags, control tags and the dictionary:

以下的图示展示了定义型标签,控制型标签和字典之间的一个象征性的交互:


(本文谢绝转载,欢迎指正错误,^_^)

本文地址:http://com.8s8s.com/it/it26653.htm