TAILIEUCHUNG - Dragging a Movie Clip Instance within a Boundary

Đang có thể kéo dụ bóng movie clip trên màn hình là dự án quan trọng đối với tương tác của chúng tôi. trên màn hình vị trí của quả bóng sẽ xác định khối lượng và panning của âm thanh nảy. Nếu chúng ta cho phép người dùng tự do kéo dụ bộ phim trên màn hình basketball_mc clip, tuy nhiên, cảnh của chúng tôi sẽ không thực tế bởi vì người sử dụng có thể kéo và trả bóng qua đám đông, các backboard. | Dragging a Movie Clip Instance within a Boundary Being able to drag the ball movie clip instance around the screen is critical to our project s interactivity. The ball s position onscreen will determine the volume and panning of the bouncing sound. If we were to allow users to freely drag the basketball_mc movie clip instance onscreen however our scene would not be realistic because the user could drag and bounce the ball over the crowd the backboard and so forth. Obviously we need to restrict dragging to the area denoted by the court. There are several ways of scripting so that an object can be dragged only within a certain area. In this exercise you ll learn how to control the draggable area by tracking the mouse s movement and allowing dragging to occur only when the mouse pointer is within a certain area onscreen. 1. Open . Continue using the file you were working with at the end of the preceding exercise. Before you continue it s important to think through the problem at hand that is how to drag the ball movie clip instance in sync with the mouse movement and how to constrain that dragging to a specific area onscreen. The first objective is to establish the draggable area or boundary of our screen. In Flash you define a boundary by determining four coordinates top bottom left and right. Our script will use these coordinates to restrict movement within that area. For this exercise the coordinates that represent the four sides of our boundary will be as follows Top boundary 220 Bottom boundary 360 Left boundary 60 Right boundary 490 As shown by the arrows all coordinates are based on the distance of that side from the top and left sides of the stage. TIP An easy and visual method of determining boundary coordinates is to draw a simple box on the stage. Resize it and position it in the area that will serve as the boundary in the scene. Select the box and then open the Info panel. Using the information in the X Y W and H boxes you can determine the

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.