|
楼主 |
发表于 2012-5-11 07:51:01
|
显示全部楼层
An Example Shape(形状举例)
This example appears to be a collection of shapes, but it can be described with a single DefineShape tag.
这个例子呈现的是一个形状集合,但它可以描述单个DefineShape标签。
The red circle, red square and green rounded-rectangle are closed paths. The curved line is an open path. The red square consists of all straight edges, the red circle consists of all curved edges, while the rounded rectangle has curved edges interspersed with straight edges.
红色的圆,红色正方型和绿色,是封闭路径。弯曲的线是一个开放的路径。红色矩形是由直边组成的,红色的圆是由弯曲组成。圆角矩形是弯曲的边穿插直边组成。
There are two fill styles; solid green and solid red, and two line styles; 1-pixel black, and 2-pixel black. The red circle and red square share the same fill and line styles. The rounded rectangle and curved line share the same line style.
有两个填充样式;实线绿色和红色,和两个线条样式;1个像素的黑色,和2个像素的黑色。红色圆圈和红色矩形采用相同的填充和相同的线条样式。圆角矩形和弯曲线采用相同的线条样式。
Here’s how to describe this example with Macromedia Flash (SWF):
下面是用 Macromedia Flash (SWF) 来如何描述这个例子
• First, the fill styles are defined with a FILLSTYLEARRAY. The two unique fill styles are solid red and solid green.
•首先,用FILLSTYLEARRAY定义填充样式。两个特定的填充样式:纯红和绿色。
• This is followed by a LINESTYLEARRAY that includes the two unique line styles; 1-pixel black, and 2-pixel black .
然后是LINESTYLEARRAY,包括两个特定的线条样式;1个像素的黑色,和2个像素的黑色。
• This is followed by an array of SHAPERECORDs.
然后是一个SHAPERECORDs数组
All shape records share a similar structure but can have varied meaning. A shape-record can define straight or curved edge, a style change, or it can move the current drawing position.
所有形状记录有着相似的结构,但可以有不同的含义。一个形状记录可以定义成直的或弯曲的边,一个样式的变化,或者它可以移动到当前绘画位置。
Now we define the curved line:
现在我们定义的曲线:
• The first shape-record selects the 2-pixel wide line style, and moves the drawing position to the top of the curved line by setting the MoveTo flag.
首先 形状记录 选择线宽度样式为2象素,通过设置MoveTo标志移动绘制位置到曲线的顶层
• The next shape-record is a curved edge, which ends to the bottom of the line. The path is not closed.
下一个的形状记录是一个弯曲的边,结束线的底部。路径是不封闭的。
Now we define the red square:
现在我们定义的红色正方形:
• The next shape-record selects the 1-pixel line style and the red fill style. It also moves the drawing position to the top-left corner of the red rectangle.
下一个形状记录选择1像素的线条样式和红色的填充样式。它还移动绘画位置到红色矩形的左上角。
• The following four shape-records are straight edges. The last edge must end at the top-left corner. Flash requires that closed figures be joined explicitly. That is, the first and last points must be co-incident.
以下四个形状记录是直边。最后的边必须在左上角结束。flash需要明确加入封闭的数字。
就是说,第一个和最后一个点必须是co-incident。
Now we define the red circle:
现在我们定义红色的圆:
• The next shape-record does not change any style settings, but moves the drawing position to the top of the red circle.
下一个形状记录不改变任何样式的设置,但移动绘图位置到顶部的红色圆
• The following eight shape-records are curved edges that define the circle. Again, the path must finish where it started.
下面是圆的弯曲边缘的形状记录有8个。该路径必须结束于开始的地方。 |
|