TAILIEUCHUNG - Using Actionscript to Draw Lines Dynamically

Sử dụng Actionscript để Draw Lines động các Sử dụng ActionScript, bạn tự động có thể rút ra dòng trong một bộ phim vì nó đóng-một khả năng mà đi kèm với một số bản vẽ các phương pháp có sẵn cho các lớp Movie Clip. Sử dụng những phương pháp này vẽ | Using Actionscript to Draw Lines Dynamically Using ActionScript you can dynamically draw lines in a movie as it plays a capability that comes with a number of drawing methods available to the Movie Clip class. Using these drawing methods you can Draw a line from the current drawing position to a point you specify Move the current drawing position without drawing Specify the line style for a timeline Fill a shape with a color Fill a shape with a gradient Curve a line between two points Clear a timeline of drawn lines and gradients In this section we ll show you how to draw lines move the drawing position set the line style and clear a movie clip instance. In the next section we ll briefly touch on using flat and gradient fills. Although we won t cover the curveTo method which allows you to dynamically draw curved lines you should understand enough about Flash drawing fundamentals by the end of the lesson that you ll be able to implement it in your own drawing applications. Using lineStyle Before drawing any lines in a timeline you must set the line style for that timeline. Flash uses this setting to determine line thickness color and alpha. Here s the syntax thickness color alpha thickness must be a value between 0 and 255 with a thickness of 0 representing a hairline . color must be a hex color value. alpha represents the transparency level for a line where 0 is transparent and 100 is opaque. Look at the following example 10 0x009900 100 This line of ActionScript sets the line style in myClip_mc so that all lines drawn will be green and opaque and have a thickness of 10. Using moveTo All movie clip instances have a drawing position that indicates the coordinate at which a line would start in other words the beginning point of a line. You use lineTo to draw the line as described in the next section. When a movie clip instance is created the drawing position is set as x 0 and y 0 however you can move the drawing position at any

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.