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 loadMovie().

Advantages over MovieClipLoader & loadMovie:
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

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

destroy

function destroy (
) : Void

getMovieClip

function getMovieClip (
) : MovieClip

Returns: