TAILIEUCHUNG - Học Actionscript 3.0 - p 40

Loading SWFs and Images load() method. The only other difference between this script and the exam- ple shown in the “Loading SWFs” section is in line 11. Because the example makes no further use of the CustomLoader class, all its listeners are removed. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import ; var swfLoader:CustomLoader = new CustomLoader("", true); addChild(swfLoader); (, onComplete, false, 0, true); function onComplete(evt:Event):void { (, onComplete); (); trace(); trace(); trace(); } N OT E The event listeners in the example FLA files are not the same as the event listeners inside the class. All the internal. | Loading SWFs and Images load method. The only other difference between this script and the example shown in the Loading SWFs section is in line 11. Because the example makes no further use of the CustomLoader class all its listeners are removed. I import 2 3 var swfLoader CustomLoader new CustomLoader true 4 addChild swfLoader 5 6 7 onComplete 8 false 0 true 9 function onComplete evt Event void 10 onComplete II 12 trace 13 trace 14 trace 15 NOTE The event listeners in the example FLA files are not the same as the event listeners inside the class. All the internal listeners are at the class level and are private so nothing outside the class is aware of their existence. The listeners in the example FLA files are applied to class instances. Loading images The second example found in the uses CustomLoader much the same way Loader is used. The instantiation process in line 3 passes no values to the constructor the verbose flag is enabled in line 4 and loading is accomplished via the load method and a URLRequest instance in line 5. Like the previous JPG loading example this script also loads the JPG directly to the display list in the last instruction of the onComplete method. This example also adds the use of the percentLoaded getter to increase the horizontal scale of a progress bar. In line 7 the progress bar is created using the createProgressBar function found at the end of the script. The function creates a sprite draws a green rectangle and returns the sprite to the progressBar variable. The sprite is then added to the display list in line 8. Two listeners are then added to the contentLoaderInfo property of the CustomLoader instance so the property is stored in a variable for efficiency. In addition

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.