TAILIEUCHUNG - Removing Dynamically Created Content

Movie clip trường hợp đó được tạo ra bằng cách sử dụng duplicateMovieClip () hoặc attachMovie (), chẳng hạn như các biểu tượng được kéo hay thả vào canvas_mc, có thể được gỡ bỏ bằng cách sử dụng một phương pháp của lớp Movie Clip được gọi là removeMovieClip (). Chú ý Bạn không thể sử dụng phương pháp này để loại bỏ các trường hợp clip bộ phim mà không tạo ra sử dụng ActionScript | Removing Dynamically Created Content You can easily remove dynamically drawn lines from a timeline using the clear method. Here s the syntax Movie clip instances that are created using duplicateMovieClip or attachMovie such as icons that are dragged and dropped onto canvas_mc can be removed using a method of the Movie Clip class called removeMovieClip . NOTE You can t use this method to remove movie clip instances that were not created using ActionScript that is instances that you ve actually dragged from the library and placed on the stage. Removing movie clip instances can be useful for dynamically clearing the stage content freeing system resources reinitializing applications or adding functionality to some applications. The syntax is simple In this exercise you ll create a function that will clear the canvas of all dynamically drawn lines as well as instances of the icon_mc movie clip instance that might be dragged and dropped onto canvas_mc. 1. Open . This is the file as you left it at the end of the preceding exercise. In this exercise you ll add a function to Frame 1 in the Actions layer of the main timeline that will clear the canvas of any content and you ll add a script to the Clear button in the window2_mc movie clip instance that calls this function. 2. With the Actions panel open select Frame 1 of the Actions layer and add the following function definition at the end of the current script 3. 4. function clearContent 5. 6. 7. 8. for var i 0 i iconDepth i 9. 10. var name String object i _mc 11. 12. _root name .removeMovieClip 13. 14. 15. 16. iconDepth 0 17. 18. 19. The first action in this function clears all dynamically drawn lines from the holder_mc movie clip instance using the clear method. A simple for loop is then used to remove any instances of the icon_mc movie clip instance that have been dragged and dropped onto the canvas. Because the value of iconDepth is incremented with

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.