Flash Builder 4 and Flex 4 Bible- P10
Số trang: 50
Loại file: pdf
Dung lượng: 792.41 KB
Lượt xem: 23
Lượt tải: 0
Xem trước 5 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Flash Builder 4 and Flex 4 Bible- P10: When Macromedia first released Flash MX in 2002, the product was branded as the newway to build Rich Internet Applications (known by the acronym RIA). The term wasinvented at Macromedia to describe a new class of applications that would offer thebenefits of being connected to the Internet, including access to various types of Web-based services,but would solve many of the nagging issues that had been inherent in browser-based applicationssince the mid-1990s....
Nội dung trích xuất từ tài liệu:
Flash Builder 4 and Flex 4 Bible- P10 Chapter 14: Declaring Graphics with MXML and FXG l Ellipse. Draws an elliptical shape. If its height and width are identical, it draws a circle. l Line. Draws a straight line from one set of coordinates to another. l Path. Draws a shape based on a set of drawing commands, creating multiple shape segments. l Rect. Draws a rectangular shape. If its height and width are identical, it draws a square. The spark.primitives package also includes the following classes that are used to group graphics together and embed graphical files in conventional formats such as PNG, GIF, and JPG: l BitmapImage. A class that embeds bitmap data defined in a graphical file. The file can be in any one of the conventional bitmap file formats: PNG, JPG, or GIF. l Graphic. A nonvisual class that can be used to group multiple FXG graphics together. When you place multiple FXG graphics within an instance of the Graphic class, they overlap each other using a layout architecture similar to a Group with a layout of BasicLayout. Drawing lines The Line class draws a line on the screen. As with all such primitives, it must be placed within a Spark application or component. Its width and height properties determine its horizontal and vertical length, while the stroke property determines its color and style. The stroke property must be set to an instance of a class that implements the IStroke inter- face. Examples of such classes in the Flex 4 SDK include GradientStroke and SolidColorStroke.CautionThe Line class’s stroke property defaults to null. If you don’t set the stroke to an instance of a class thatimplements the IStroke interface, the line is invisible. n The following code draws a simple horizontal line. The stroke property is set to an instance of SolidColorStroke with a color of black (#000000) and a weight of 2 pixels: Using gradient strokes As with the fill property used with shapes that are drawn with the Rect, Ellipse, and Path classes (described in the following sections), the stroke property can be set to a gradient of two or more colors with the GradientStroke class or with one of its subclasses, LinearGradientStroke and RadialGradientStroke. 421Part II: Designing Flex Applications The gradient stroke classes support a property named entries that’s set to an array of two or more instances of the GradientEntry class. The following code draws a horizontal line that’s 10 pixels wide and has five entries: Figure 14.1 shows the resulting line, with alternating black and white colors. FIGURE 14.1A horizontal line with a gradient stroke Drawing rectangular and elliptical shapes The two most commonly used primitive vector graphic classes are Rect and Ellipse. Respectively, they render rectangular and elliptical shapes on the screen. Both support fill and stroke prop- erties, which enable you to define the outer border and inner fill of the shape you’re drawing. Each shape’s fill property can be set to an instance of a class that implements the IFill inter- face. Examples of such classes in the Flex 4 SDK include: l BitmapFill l LinearGradient l RadialGradient l SolidColor And, as described in the previous section on the Line class, each shape’s stroke property is set to an instance of a class that implements the IStroke interface.422 Chapter 14: Declaring Graphics with MXML and FXGNoteAll shape classes support the x, y, top, bottom, left, right, horizontalCenter, and verticalCenterproperties to control a shape’s position within its container, and the height and width properties to controlits dimensions. As with all Flex visual components, the height and width can be set either to a numeric valuerepresenting a certain number of pixels or to a percentage value. n The following MXML code defines a rectangle with dimensions of 400 pixels width by 300 pixels height. ...
Nội dung trích xuất từ tài liệu:
Flash Builder 4 and Flex 4 Bible- P10 Chapter 14: Declaring Graphics with MXML and FXG l Ellipse. Draws an elliptical shape. If its height and width are identical, it draws a circle. l Line. Draws a straight line from one set of coordinates to another. l Path. Draws a shape based on a set of drawing commands, creating multiple shape segments. l Rect. Draws a rectangular shape. If its height and width are identical, it draws a square. The spark.primitives package also includes the following classes that are used to group graphics together and embed graphical files in conventional formats such as PNG, GIF, and JPG: l BitmapImage. A class that embeds bitmap data defined in a graphical file. The file can be in any one of the conventional bitmap file formats: PNG, JPG, or GIF. l Graphic. A nonvisual class that can be used to group multiple FXG graphics together. When you place multiple FXG graphics within an instance of the Graphic class, they overlap each other using a layout architecture similar to a Group with a layout of BasicLayout. Drawing lines The Line class draws a line on the screen. As with all such primitives, it must be placed within a Spark application or component. Its width and height properties determine its horizontal and vertical length, while the stroke property determines its color and style. The stroke property must be set to an instance of a class that implements the IStroke inter- face. Examples of such classes in the Flex 4 SDK include GradientStroke and SolidColorStroke.CautionThe Line class’s stroke property defaults to null. If you don’t set the stroke to an instance of a class thatimplements the IStroke interface, the line is invisible. n The following code draws a simple horizontal line. The stroke property is set to an instance of SolidColorStroke with a color of black (#000000) and a weight of 2 pixels: Using gradient strokes As with the fill property used with shapes that are drawn with the Rect, Ellipse, and Path classes (described in the following sections), the stroke property can be set to a gradient of two or more colors with the GradientStroke class or with one of its subclasses, LinearGradientStroke and RadialGradientStroke. 421Part II: Designing Flex Applications The gradient stroke classes support a property named entries that’s set to an array of two or more instances of the GradientEntry class. The following code draws a horizontal line that’s 10 pixels wide and has five entries: Figure 14.1 shows the resulting line, with alternating black and white colors. FIGURE 14.1A horizontal line with a gradient stroke Drawing rectangular and elliptical shapes The two most commonly used primitive vector graphic classes are Rect and Ellipse. Respectively, they render rectangular and elliptical shapes on the screen. Both support fill and stroke prop- erties, which enable you to define the outer border and inner fill of the shape you’re drawing. Each shape’s fill property can be set to an instance of a class that implements the IFill inter- face. Examples of such classes in the Flex 4 SDK include: l BitmapFill l LinearGradient l RadialGradient l SolidColor And, as described in the previous section on the Line class, each shape’s stroke property is set to an instance of a class that implements the IStroke interface.422 Chapter 14: Declaring Graphics with MXML and FXGNoteAll shape classes support the x, y, top, bottom, left, right, horizontalCenter, and verticalCenterproperties to control a shape’s position within its container, and the height and width properties to controlits dimensions. As with all Flex visual components, the height and width can be set either to a numeric valuerepresenting a certain number of pixels or to a percentage value. n The following MXML code defines a rectangle with dimensions of 400 pixels width by 300 pixels height. ...
Tìm kiếm theo từ khóa liên quan:
thiết kế web giáo trình flash cơ bản kỹ năng cắt html photoshop căn bản giáo trình CS3Tài liệu có liên quan:
-
Báo cáo thực tập: Đề tài thiết kế Web
77 trang 601 2 0 -
Đề thi thực hành môn Thiết kế Web - Trường Cao đẳng nghề Vĩnh Phúc
3 trang 301 2 0 -
MỘT SỐ ĐIỂM CẦN CHÚ Ý KHI THIẾT KẾ WEB
5 trang 118 0 0 -
GIÁO TRÌNH LẬP TRÌNH WEB_PHẦN 2_BÀI 3
3 trang 110 0 0 -
81 trang 93 0 0
-
Giáo trình Nhập môn thiết kế website
58 trang 89 0 0 -
Tài liệu giảng dạy Thiết kế giao diện Web - Trường CĐ Kinh tế - Kỹ thuật Vinatex TP. HCM
88 trang 79 0 0 -
112 trang 72 0 0
-
Hướng dân sử dụng Navicat để Create , Backup , Restore Database
7 trang 71 0 0 -
Giáo trình môn Kỹ thuật vi điều khiển: Thiết kế web và vi điều khiển - Chương 2
39 trang 68 0 0