TAILIEUCHUNG - Using ActionScript in Flash-P4

Tham khảo tài liệu 'using actionscript in flash-p4', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Preloading SWF and JPEG files To preload SWF and JPEG files into movie clip instances you can use the MovieClipLoader class . This class provides an event listener mechanism to give notification about the status of file downloads into movie clips. Using a MovieClipLoader object to preload SWF and JPEG files involves the following steps Create a new MovieClipLoader object You can use a single MovieClipLoader object to track the download progress of multiple files or create a separate object for each file s progress. Create a new movie clip load your contents into it and then create the MovieClipLoader object. target_mc 999 var loader MovieClipLoader new MovieClipLoader Create a listener object and create event handlers The listener object can be any ActionScript object such as a generic Object object a movie clip or a custom component. For example the following code creates a generic listener object named loadListener and defines for itself onLoadStart onLoadProgress and onLoadComplete functions var loader MovieClipLoader new MovieClipLoader Create listener object var loadListener Object new Object function loadTarget trace Loading into loadTarget has started. function loadTarget bytesLoaded bytesTotal var percentLoaded bytesLoaded bytesTotal 100 trace percentLoaded into target loadTarget function loadTarget trace Load completed into loadTarget Register the listener object with the MovieClipLoader object In order for the listener object to receive the loading events you must register it with the MovieClipLoader object as shown in the following code loadListener Begin loading the file JPEG or SWF into a target clip To start the download of the JPEG or SWF file you use the method as shown in the following code target_mc Note You can use MovieClipLoader methods only to track the download .

TỪ KHÓA LIÊN QUAN
Đã 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.