TAILIEUCHUNG - Essential ActionScript 3.0 PHẦN 8

Khi tạo ra các điều khiển giao diện người dùng với các hiệu ứng hoạt hình, xem xét mở rộng lớp khung Flex hơn là tạo ra một thư viện hình ảnh động tùy chỉnh. cácMột bản demo Animator (tiếp theo) | Example 24-9. An Animator demo continued Create a circle to animate var circle Shape new Shape 10 0x666666 0X999999 0 0 25 addChild circle Create an Animator to animate the circle circleAnimator new Animator circle Register for mouse clicks mouseDownListener When the user clicks the stage animate the circle to the point that was clicked. private function mouseDownListener e MouseEvent void Convert the point from the Stage instance s coordinate system to this AnimationLibDemo instance s coordinate system var mousePt Point globalToLocal new Point 500 _ _ jr When creating user interface controls with animated effects consider extending the Flex framework s class rather ĨỊÃ than creating a custom animation library. The UIComponent class comes equipped with an extensive toolset for adding effects to custom user interface controls. Velocity-Based Animation In the Flash runtime the specific timing of both scheduled screen-update checks and events is not guaranteed. The event often executes later than the time scheduled by the designated frame rate and events often occur later than the time specified by a Timer object s delay variable. These delays can result in unpredictable animation. To guarantee that a given object will travel a specified distance in a specified amount of time we must set its position according to its velocity . its rate of speed in a particular direction . Example 24-10 shows the basic technique. Example 24-10. Calculating position based on velocity package import . import . import . Velocity-Based Animation 627 Example 24-10. Calculating position based on velocity continued Moves an object a specified number of pixels per second no matter what the frame rate

TỪ KHÓA LIÊN QUAN
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.