Add an event listener
Dispatch an event
check if an object has an event listener assigned to it
Remove an event listener
The bytes associated with a LoaderInfo object.
The number of bytes that are loaded for the media. When this number equals
the value of bytesTotal, all of the bytes are loaded.
The number of compressed bytes in the entire media file.
Before the first progress event is dispatched by this
LoaderInfo object's corresponding Loader object, bytesTotal
is 0. After the first progress event from the Loader object,
bytesTotal reflects the actual number of bytes to be
downloaded.
The loaded object associated with this LoaderInfo object.
The MIME type of the loaded file. The value is null if not
enough of the file has loaded in order to determine the type. The
following list gives the possible values:
"application/x-shockwave-flash""image/jpeg""image/gif""image/png"The Loader object associated with this LoaderInfo object. If this
LoaderInfo object is the loaderInfo property of the instance
of the main export class of the SWF file, no Loader object is associated.
The URL of the media being loaded.
Before the first progress event is dispatched by this
LoaderInfo object's corresponding Loader object, the value of the
url property might reflect only the initial URL specified in
the call to the load() method of the Loader object. After the
first progress event, the url property reflects
the media's final URL, after any redirects and relative URLs are
resolved.
In some cases, the value of the url property is truncated;
see the isURLInaccessible property for details.
Generated using TypeDoc
The LoaderInfo export class provides information about a loaded SWF file or a loaded image file(JPEG, GIF, or PNG). LoaderInfo objects are available for any display object. The information provided includes load progress, the URLs of the loader and loaded content, the number of bytes total for the media, and the nominal height and width of the media.
You can access LoaderInfo objects in two ways:
contentLoaderInfoproperty of a flash.display.Loader object - ThecontentLoaderInfoproperty is always available for any Loader object. For a Loader object that has not called theload()orloadBytes()method, or that has not sufficiently loaded, attempting to access many of the properties of thecontentLoaderInfoproperty throws an error.loaderInfoproperty of a display object.The
contentLoaderInfoproperty of a Loader object provides information about the content that the Loader object is loading, whereas theloaderInfoproperty of a DisplayObject provides information about the root SWF file for that display object.When you use a Loader object to load a display object(such as a SWF file or a bitmap), the
loaderInfoproperty of the display object is the same as thecontentLoaderInfoproperty of the Loader object(DisplayObject.loaderInfo = Loader.contentLoaderInfo). Because the instance of the main export class of the SWF file has no Loader object, theloaderInfoproperty is the only way to access the LoaderInfo for the instance of the main export class of the SWF file.The following diagram shows the different uses of the LoaderInfo object - for the instance of the main export class of the SWF file, for the
contentLoaderInfoproperty of a Loader object, and for theloaderInfoproperty of a loaded object:When a loading operation is not complete, some properties of the
contentLoaderInfoproperty of a Loader object are not available. You can obtain some properties, such asbytesLoaded,bytesTotal,url,loaderURL, andapplicationDomain. When theloaderInfoobject dispatches theinitevent, you can access all properties of theloaderInfoobject and the loaded image or SWF file.Note: All properties of LoaderInfo objects are read-only.
The
EventDispatcher.dispatchEvent()method is not applicable to LoaderInfo objects. If you calldispatchEvent()on a LoaderInfo object, an IllegalOperationError exception is thrown.