TAILIEUCHUNG - Orchestrating Multiple Events

Nhiều sự kiện phối Như bạn đã có thể tìm ra bởi hiện nay, các sự kiện khác nhau có thể xảy ra đồng thời trong phim của bạn. Ví dụ, người sử dụng có thể có nút chuột ép xuống (kích hoạt một sự kiện báo chí chuột) trong khi di chuyển con chuột trên màn hình (kích hoạt một sự kiện clip mouseMove). | Orchestrating Multiple Events As you ve probably figured out by now different events can occur simultaneously in your movie. For example the user can have the mouse button pressed down triggering a press mouse event while moving the mouse around the screen triggering a mouseMove clip event . By writing scripts that work in harmony while multiple events are occurring you can add powerful interactivity to your projects. In this exercise you ll orchestrate several events to simulate a cue ball s being hit with a pool stick. Although there are some quite sophisticated ways of doing this we take an intermediate approach. 1. Open in the Lesson02 Assets folder. This project contains a single scene with six layers that are named according to their contents. The white cue ball is a movie clip instance named ball_mc. We ll soon be attaching some scripts to this clip. To the right of this instance is a transparentblue rectangle an invisible button that will contain some scripts which when used in tandem with those on the ball_mc movie clip instance will facilitate the interactivity we seek. To the right of this button is a graphic of a pool stick. This is a movie clip instance named stick_mc. The timeline of this movie clip contains two frame labels Starting and PullBack. At the Starting label the stick is up against the ball. At the PullBack label the stick is animated so that it looks like it s being pulled to the right in anticipation of hitting the ball. Just above the pool stick is a text field instance named powerAmount_txt that displays the power at which the ball is hit based on how far the stick has been pulled to the right. We re going to set up our project so that when the user presses pulls away from and releases the invisible button the distance between the point where it was first pressed and where it was released will be calculated. That amount will be used to move the ball to the left. The greater the distance the farther the ball will

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.