Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Học Actionscript 3.0 - p 16
Đang chuẩn bị liên kết để tải về tài liệu:
Học Actionscript 3.0 - p 16
Ðức Nhân
81
10
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Inheritance so they can behave as a timeline. Lines 9 and 10 create two properties, compact and pickup, and type them as Car and Truck, respectively. Lines 14 and 20 create instances to these classes, passing in values for gas mileage and fuel available. Both compact and pickup are set to the same initial x value (lines 15 and 21), and pickup is given a different y value (line 22) so you can easily see both vehicles once they are added to the display list (lines 17 and 23). The custom methods for both instances are called right away (lines 18. | Inheritance so they can behave as a timeline. Lines 9 and 10 create two properties compact and pickup and type them as Car and Truck respectively. Lines 14 and 20 create instances to these classes passing in values for gas mileage and fuel available. Both compact and pickup are set to the same initial x value lines 15 and 21 and pickup is given a different y value line 22 so you can easily see both vehicles once they are added to the display list lines 17 and 23 . The custom methods for both instances are called right away lines 18 and 24 but the vehicles don t move because the go method calls are inside an event listener function lines 38 through 41 waiting for you to click the stage. Setting up the event listeners in lines 26 through 36 is very important and we ll discuss this after the code and a description of this example s output. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 package import flash.display.MovieClip import flash.events.Event import flash.events.MouseEvent public class Main extends MovieClip public var compact Car public var pickup Truck public function Main compact new Car 21 18 compact.x 0 compact.y 20 addChild compact compact.openSunroof pickup new Truck 16 23 pickup.x 0 pickup.y 100 addChild pickup pickup.lowerTailgate this.addEventListener Event.ADDED_TO_STAGE onAddedToStage false 0 true public function onAddedToStage evt Event void this.removeEventListener Event.ADDED_TO_STAGE onAddedToStage stage.addEventListener MouseEvent.CLICK onClick false 0 true public function onClick evt MouseEvent void compact.go pickup.go Chapter 6 OOP 129 Download from Wow eBook www.wowebook.com Inheritance The first thing to appear in the Output panel when testing your FLA is the initial trace caused by the custom method calls object Car opened sunroof object Truck lowered tailgate When the stage is clicked the go methods start the car and truck moving and traces like the one seen in the
TÀI LIỆU LIÊN QUAN
TỪ ĐIỂN ActionScript
Flash: ActionScript Language Reference- P1
Flash: ActionScript Language Reference- P2
Flash: ActionScript Language Reference- P3
Flash: ActionScript Language Reference- P4
Flash: ActionScript Language Reference- P5
Flash: ActionScript Language Reference- P6
Flash: ActionScript Language Reference- P7
Flash: ActionScript Language Reference- P8
Flash: ActionScript Language Reference- P9
crossorigin="anonymous">
Đã 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.