MediaLoad
Kind of class: | class |
---|---|
Inherits from: | BytesLoad < RetryableLoad < Load < EventDispatcher < CoreObject |
Known subclasses: | |
Version: | 01/26/07 |
Author: | Aaron Clinger |
Classpath: | org.casalib.load.media.MediaLoad |
File last modified: | Monday, 01 December 2008, 13:34:40 |
Allows the implementation of event observers that provide status information while SWF, JPEG, GIF, and PNG files are being loaded into a MovieClip or level. This is designed to replace
Advantages over MovieClipLoader &
loadMovie()
.Advantages over MovieClipLoader &
loadMovie
:- Includes org.casalib.load.base.RetryableLoad.setLoadRetries and org.casalib.load.base.BytesLoad.setLoadTimeout.
- Sends load events using org.casalib.event.EventDispatcher.
- Does not immediatly start loading on definition. Load can be started at anytime with org.casalib.load.base.Load.start.
- Built in org.casalib.load.base.Load.stop which ends a current load or unloads a completed load.
- Option to hide content until file has completely loaded.
Since:
- Flash Player 7
Example:
-
this.createEmptyMovieClip("loadZone_mc", this.getNextHighestDepth()); function onImageLoadProgress(sender:MediaLoad, bytesLoaded:Number, bytesTotal:Number):Void { trace(bytesLoaded + "/" + bytesTotal + " bytes have been loaded into " + sender.getMovieClip()); } var mediaLoad:MediaLoad = new MediaLoad(this.loadZone_mc, "test.jpg"); this.mediaLoad.addEventObserver(this, MediaLoad.EVENT_LOAD_PROGRESS, "onImageLoadProgress"); this.mediaLoad.start();
Summary
Constructor
- MediaLoad (target_mc:MovieClip, filePath:String, hideUntilLoaded:Boolean)
- Defines file and location of load triggered by start.
Class properties
Class properties inherited from BytesLoad
Class properties inherited from RetryableLoad
Class properties inherited from Load
Instance methods
- getMovieClip : MovieClip
- destroy : Void
Instance methods inherited from BytesLoad
Instance methods inherited from RetryableLoad
Instance methods inherited from Load
Instance methods inherited from EventDispatcher
Instance methods inherited from CoreObject
Constructor
MediaLoad
function MediaLoad (
target_mc:MovieClip,
filePath:String,
hideUntilLoaded:Boolean)
Defines file and location of load triggered by start.
Parameters:
target_mc :
A path to a MovieClip container where the file specified by
filePath
should be loaded into.filePath :
The absolute or relative URL of the SWF, JPEG, GIF, or PNG file to be loaded.
hideUntilLoaded:
[optional] Indicates to hide
target_mc
and its contents until file has completely loaded true
, or to display contents while loading false
; defaults to false
.Usage note:
- Loading of GIF or PNG is only allowed when publishing to Flash Player 8 or greater.