TAILIEUCHUNG - Học Actionscript 3.0 - p 41

Communicating with Loaded SWFs maximum, and default. We’ve set the maximum to 50, and the default to 0, and we’re incrementing the minimum by 1 every enter frame. When the value reaches 50, the event listener is removed, halting the animation (lines 62 through 65). 56 57 58 59 60 61 62 63 64 65 66 67 68 //adjust filter values private function onEnter(evt:Event):void { = [_shaderFilter]; _val++; = [_val, 50, 0]; if (_val = 50) { (, onEnter); } } } } Communicating with Loaded SWFs Now that you know how to load SWFs, let’s talk about communicating between them. For this discussion, we’ll reference the Loader class, but the ideas in this section apply. | Communicating with Loaded SWFs maximum and default. We ve set the maximum to 50 and the default to 0 and we re incrementing the minimum by 1 every enter frame. When the value reaches 50 the event listener is removed halting the animation lines 62 through 65 . 56 57 58 59 60 61 62 63 64 65 66 67 68 adjust filter values private function onEnter evt Event void _shaderFilter _val _val 50 0 if _val 50 onEnter Communicating with Loaded SWFs Now that you know how to load SWFs let s talk about communicating between them. For this discussion we ll reference the Loader class but the ideas in this section apply equally to the CustomLoader class. The key to communicating between a parent SWF created with ActionScript and a loaded SWF created with ActionScript is understanding the position of the Loader instance between the two SWFs. Within the parent accessing the child SWF is straightforward because you need only do so through the Loader instance. The same is true in the other direction from child to parent but is less obvious to some. Just like when traversing the display list you can use within a loaded child SWF to talk to its parent. However this will refer to the Loader instance not the SWF s main timeline or document class scope. The following examples found in the and source files demonstrate several tasks you may need to perform when communicating between parent and child SWFs including getting or setting properties calling methods and calling functions. This exercise shows communication in both directions. Both SWFs contain a simple movie clip animation a function and a variable. They both trace information to help you understand what s happening when the parent SWF loads the child SWF into a Loader instance. NOTE To see the CustomLoader class used in this context consult the nearly identical source files .

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.