MediaLoad
| Kind of class: | class |
|---|---|
| Inherits from: | BytesLoad < RetryableLoad < Load < EventDispatcher < CoreObject |
| Known subclasses: | |
| Version: | 12/20/06 |
| Author: | Aaron Clinger |
| Classpath: | org.casaframework.load.media.MediaLoad |
| File last modified: | Monday, 08 January 2007, 09:57:51 |
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 loadMovie().Advantages over MovieClipLoader &
loadMovie:- Includes org.casaframework.load.base.RetryableLoad.setLoadRetries and org.casaframework.load.base.BytesLoad.setLoadTimeout.
- Sends load events using org.casaframework.event.EventDispatcher.
- Does not immediatly start loading on definition. Load can be started at anytime with org.casaframework.load.base.Load.start.
- Built in org.casaframework.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
Class properties
Class properties inherited from BytesLoad
Class properties inherited from RetryableLoad
Class properties inherited from Load
Instance properties
Instance properties inherited from BytesLoad
Instance properties inherited from RetryableLoad
Instance properties inherited from Load
Instance properties inherited from EventDispatcher
Instance properties inherited from CoreObject
Instance methods
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.
Instance methods
getMovieClip
function getMovieClip (
) : MovieClip
Returns:
Returns MovieClip specified in MediaLoad.