You can access LoaderInfo objects in two ways:
contentLoaderInfoproperty of a nme.display.Loader object - The
contentLoaderInfoproperty is always available for any Loader object. For a Loader object that has not called the
loadBytes()method, or that has not sufficiently loaded, attempting to access many of the properties of the
contentLoaderInfoproperty throws an error.
loaderInfoproperty of a display object.
contentLoaderInfo property of a Loader object provides
information about the content that the Loader object is loading, whereas
loaderInfo property 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
loaderInfo property of the display
object is the same as the
contentLoaderInfo property of the
Loader.contentLoaderInfo). Because the instance of the main class of
the SWF file has no Loader object, the
loaderInfo property is
the only way to access the LoaderInfo for the instance of the main class of
the SWF file.
The following diagram shows the different uses of the LoaderInfo
object - for the instance of the main class of the SWF file, for the
contentLoaderInfo property of a Loader object, and for the
loaderInfo property of a loaded object:
When a loading operation is not complete, some properties of the
contentLoaderInfo property of a Loader object are not
available. You can obtain some properties, such as
applicationDomain. When the
loaderInfo object dispatches the
init event, you
can access all properties of the
loaderInfo object and the
loaded image or SWF file.
Note: All properties of LoaderInfo objects are read-only.
EventDispatcher.dispatchEvent() method is not
applicable to LoaderInfo objects. If you call
on a LoaderInfo object, an IllegalOperationError exception is thrown.
objectThe object for which you want to get an associated LoaderInfo object.
nullwhen called in non-debugger builds(or when debugging is not enabled) or if the referenced
objectdoes not have an associated LoaderInfo object(such as some objects used by the AIR runtime).
SecurityErrorThe caller is not running in the local trusted sandbox.
typeThe type of event.
useCaptureDetermines whether the listener works in the capture phase or the target and bubbling phases. If
useCaptureis set to
true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If
false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call
addEventListenertwice, once with
true, then again with
priorityThe priority level of the event listener. The priority is designated by a signed 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0.
useWeakReferenceDetermines whether the reference to the listener is strong or weak. A strong reference(the default) prevents your listener from being garbage-collected. A weak reference does not.
Class-level member functions are not subject to garbage collection, so you can set
true for class-level member functions without subjecting them to garbage collection. If you set
true for a listener that is a nested inner function, the function will be garbage-collected and no longer persistent. If you create references to the inner function(save it in another variable) then it is not garbage-collected and stays persistent.
listenerspecified is not a function.
eventThe Event object that is dispatched into the event flow. If the event is being redispatched, a clone of the event is created automatically. After an event is dispatched, its
targetproperty cannot be changed, so you must create a new copy of the event for redispatching to work.
trueif the event was successfully dispatched. A value of
falseindicates failure or that
preventDefault()was called on the event.
ErrorThe event dispatch recursion limit has been reached.
typeThe type of event.
useCaptureSpecifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to
removeEventListener()are required to remove both, one call with
true, and another call with