Creating an Interactive Placeholder

Tạo một Trinh Giư Chô Interactive A giữ chỗ là không có gì hơn một dụ movie clip (trống hay cách khác) vào đó bên ngoài nội dung có thể được nạp (còn được gọi là nhắm mục tiêu một). Tạo ra một tương tác liên quan đến việc giữ chỗ giữ chỗ cho rằng khả năng tương tác khi một sự kiện của một số loại xảy ra. | Creating an Interactive Placeholder A placeholder is nothing more than a movie clip instance empty or otherwise into which external content can be loaded also known as a target . Creating an interactive placeholder involves giving that placeholder the capability of interactivity when an event of some sort occurs. The great thing about loading external content into an instance that has been scripted in such a way is that even though the instance s content will change its scripted functionality can remain the same. Look at the following example function 30 If you attach this script to the main timeline the placeholder_mc instance rotates 30 degrees each time the mouse is clicked. This instance can be thought of as an interactive placeholder because any external movie or JPG loaded into it will also rotate when the mouse is clicked. The only thing that changes is the instance s content. There are many ways to create interactive placeholder movie clip instances with a minimum of scripting. The following exercise shows an example. 1. Open . When we worked with this file in the preceding exercise we set the movie to dynamically load JPGs into the movie clip instance named placeholder_mc. In this exercise we ll add ActionScript to make the loaded content draggable and to scale it 150 percent when the mouse button is pressed. The ActionScript will also ensure that when the mouse button is released dragging ceases and the content is scaled back to 100 percent. In the process of setting up this functionality we ll use the black rectangle a movie clip instance named maskClip_mc on the left of the stage as a dynamic mask. Let s get started. 2. With the Actions panel open select Frame 1 of the Actions layer and add the following script at the end of the current script 3. 4. var placeholderStartX Number 5. 6. var placeholderStartY Number 7. This script creates two variables whose .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.