ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Hide Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes

Language Reference only
Filters: AIR 32.0 and earlier, Flash Player 32.0 and earlier, Flash Lite 4
Flex 4.6 and earlier, Flash Pro CS6 and earlier
Hide Filters
flash.display 

LoaderInfo  - AS3

Packagesx

Top Level
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

Language Elements

Global Constants
Global Functions
Operators
Statements, Keywords & Directives
Special Types

Appendixes

What's New
Compiler Errors
Compiler Warnings
Run-Time Errors
Migrating to ActionScript 3
Supported Character Sets
MXML Only Tags
Motion XML Elements
Timed Text Tags
List of deprecated elements
Accessibility Implementation Constants
How to Use ActionScript Examples
Legal notices
Packageflash.display
Classpublic class LoaderInfo
InheritanceLoaderInfo Inheritance EventDispatcher Inheritance Object

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The LoaderInfo 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:

  • The contentLoaderInfo property of a flash.display.Loader object— The contentLoaderInfo property is always available for any Loader object. For a Loader object that has not called the load() or loadBytes() method, or that has not sufficiently loaded, attempting to access many of the properties of the contentLoaderInfo property throws an error.
  • The loaderInfo property of a display object.

The contentLoaderInfo property of a Loader object provides information about the content that the Loader object is loading, whereas the 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 object (DisplayObject.loaderInfo = 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:

An image of different LoaderInfo situations

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 bytesLoaded, bytesTotal, url, loaderURL, and 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.

The EventDispatcher.dispatchEvent() method is not applicable to LoaderInfo objects. If you call dispatchEvent() on a LoaderInfo object, an IllegalOperationError exception is thrown.

View the examples

More examples

Learn more

Related API Elements



Public Properties
 PropertyDefined By
  actionScriptVersion : uint
[read-only] The ActionScript version of the loaded SWF file.
LoaderInfo
  applicationDomain : ApplicationDomain
[read-only] When an external SWF file is loaded, all ActionScript 3.0 definitions contained in the loaded class are stored in the applicationDomain property.
LoaderInfo
  bytes : ByteArray
[read-only] The bytes associated with a LoaderInfo object.
LoaderInfo
  bytesLoaded : uint
[read-only] The number of bytes that are loaded for the media.
LoaderInfo
  bytesTotal : uint
[read-only] The number of compressed bytes in the entire media file.
LoaderInfo
  childAllowsParent : Boolean
[read-only] Expresses the trust relationship from content (child) to the Loader (parent).
LoaderInfo
  childSandboxBridge : Object
A object that can be set by the loaded content's code to expose properties and methods that can be accessed by code in the Loader object's sandbox.
LoaderInfo
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  content : DisplayObject
[read-only] The loaded object associated with this LoaderInfo object.
LoaderInfo
  contentType : String
[read-only] The MIME type of the loaded file.
LoaderInfo
  frameRate : Number
[read-only] The nominal frame rate, in frames per second, of the loaded SWF file.
LoaderInfo
  height : int
[read-only] The nominal height of the loaded file.
LoaderInfo
  isURLInaccessible : Boolean
[read-only] Indicates if the LoaderInfo.url property has been truncated.
LoaderInfo
  loader : Loader
[read-only] The Loader object associated with this LoaderInfo object.
LoaderInfo
  loaderURL : String
[read-only] The URL of the SWF file that initiated the loading of the media described by this LoaderInfo object.
LoaderInfo
  parameters : Object
[read-only] An object that contains name-value pairs that represent the parameters provided to the loaded SWF file.
LoaderInfo
  parentAllowsChild : Boolean
[read-only] Expresses the trust relationship from Loader (parent) to the content (child).
LoaderInfo
  parentSandboxBridge : Object
A object that can be set by code in the Loader object's sandbox to expose properties and methods that can be accessed by the loaded content's code.
LoaderInfo
  sameDomain : Boolean
[read-only] Expresses the domain relationship between the loader and the content: true if they have the same origin domain; false otherwise.
LoaderInfo
  sharedEvents : EventDispatcher
[read-only] An EventDispatcher instance that can be used to exchange events across security boundaries.
LoaderInfo
  swfVersion : uint
[read-only] The file format version of the loaded SWF file.
LoaderInfo
  uncaughtErrorEvents : UncaughtErrorEvents
[read-only] An object that dispatches an uncaughtError event when an unhandled error occurs in code in this LoaderInfo object's SWF file.
LoaderInfo
  url : String
[read-only] The URL of the media being loaded.
LoaderInfo
  width : int
[read-only] The nominal width of the loaded content.
LoaderInfo
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
  
[static] Returns the LoaderInfo object associated with a SWF file defined as an object.
LoaderInfo
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
  Dispatched when data has loaded successfully.LoaderInfo
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
  Dispatched when a network request is made over HTTP and an HTTP status code can be detected.LoaderInfo
  Dispatched when the properties and methods of a loaded SWF file are accessible and ready for use.LoaderInfo
  Dispatched when an input or output error occurs that causes a load operation to fail.LoaderInfo
  Dispatched when a load operation starts.LoaderInfo
  Dispatched when data is received as the download operation progresses.LoaderInfo
  Dispatched by a LoaderInfo object whenever a loaded object is removed by using the unload() method of the Loader object, or when a second load is performed by the same Loader object and the original content is removed prior to the load beginning.LoaderInfo
Property Detail

actionScriptVersion

property
actionScriptVersion:uint  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The ActionScript version of the loaded SWF file. The language version is specified by using the enumerations in the ActionScriptVersion class, such as ActionScriptVersion.ACTIONSCRIPT2 and ActionScriptVersion.ACTIONSCRIPT3.

Note: This property always has a value of either ActionScriptVersion.ACTIONSCRIPT2 or ActionScriptVersion.ACTIONSCRIPT3. ActionScript 1.0 and 2.0 are both reported as ActionScriptVersion.ACTIONSCRIPT2 (version 2.0). This property only distinguishes ActionScript 1.0 and 2.0 from ActionScript 3.0.



Implementation
    public function get actionScriptVersion():uint

Throws
Error — If the file is not downloaded sufficiently to retrieve the requested information.
 
Error — If the file is not a SWF file.

Related API Elements

applicationDomain

property 
applicationDomain:ApplicationDomain  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

When an external SWF file is loaded, all ActionScript 3.0 definitions contained in the loaded class are stored in the applicationDomain property.

All code in a SWF file is defined to exist in an application domain. The current application domain is where your main application runs. The system domain contains all application domains, including the current domain and all classes used by Flash Player or Adobe AIR.

All application domains, except the system domain, have an associated parent domain. The parent domain of your main application's applicationDomain is the system domain. Loaded classes are defined only when their parent doesn't already define them. You cannot override a loaded class definition with a newer definition.

For usage examples of application domains, see the "Client System Environment" chapter in the ActionScript 3.0 Developer's Guide.



Implementation
    public function get applicationDomain():ApplicationDomain

Throws
SecurityError — This security sandbox of the caller is not allowed to access this ApplicationDomain.

More examples

Learn more

Related API Elements

bytes

property 
bytes:ByteArray  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9.0.115.0, Flash Lite 4

The bytes associated with a LoaderInfo object.



Implementation
    public function get bytes():ByteArray

Throws
SecurityError — If the object accessing this API is prevented from accessing the loaded object due to security restrictions. This situation can occur, for instance, when a Loader object attempts to access the contentLoaderInfo.content property and it is not granted security permission to access the loaded content.

For more information related to security, see the Flash Player Developer Center Topic: Security.

bytesLoaded

property 
bytesLoaded:uint  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The number of bytes that are loaded for the media. When this number equals the value of bytesTotal, all of the bytes are loaded.



Implementation
    public function get bytesLoaded():uint

bytesTotal

property 
bytesTotal:uint  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

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.

Note (iOS only): When running an application on iOS, the value returned is not the same as on other platforms.



Implementation
    public function get bytesTotal():uint

Related API Elements

childAllowsParent

property 
childAllowsParent:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Expresses the trust relationship from content (child) to the Loader (parent). If the child has allowed the parent access, true; otherwise, false. This property is set to true if the child object has called the allowDomain() method to grant permission to the parent domain or if a URL policy is loaded at the child domain that grants permission to the parent domain. If child and parent are in the same domain, this property is set to true.

For more information related to security, see the Flash Player Developer Center Topic: Security.



Implementation
    public function get childAllowsParent():Boolean

Throws
Error — Thrown if the file is not downloaded sufficiently to retrieve the requested information.

childSandboxBridge

property 
childSandboxBridge:Object

Runtime Versions: AIR 1.0, Flash Player 11.4, Flash Lite 4

A object that can be set by the loaded content's code to expose properties and methods that can be accessed by code in the Loader object's sandbox. This sandbox bridge lets content from a non-application domain have controlled access to scripts in the application sandbox, and vice versa. The sandbox bridge serves as a gateway between the sandboxes, providing explicit interaction between application and non-application security sandboxes.



Implementation
    public function get childSandboxBridge():Object
    public function set childSandboxBridge(value:Object):void

Throws
SecurityError — Only content in the loaded content's sandbox can set this property.

Related API Elements

content

property 
content:DisplayObject  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The loaded object associated with this LoaderInfo object.



Implementation
    public function get content():DisplayObject

Throws
SecurityError — If the object accessing this API is prevented from accessing the loaded object due to security restrictions. This situation can occur, for instance, when a Loader object attempts to access the contentLoaderInfo.content property and it is not granted security permission to access the loaded content.

For more information related to security, see the Flash Player Developer Center Topic: Security.

contentType

property 
contentType:String  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

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"



Implementation
    public function get contentType():String

frameRate

property 
frameRate:Number  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The nominal frame rate, in frames per second, of the loaded SWF file. This number is often an integer, but need not be.

This value may differ from the actual frame rate in use. Flash Player or Adobe AIR only uses a single frame rate for all loaded SWF files at any one time, and this frame rate is determined by the nominal frame rate of the main SWF file. Also, the main frame rate may not be able to be achieved, depending on hardware, sound synchronization, and other factors.



Implementation
    public function get frameRate():Number

Throws
Error — If the file is not downloaded sufficiently to retrieve the requested information.
 
Error — If the file is not a SWF file.

height

property 
height:int  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The nominal height of the loaded file. This value might differ from the actual height at which the content is displayed, since the loaded content or its parent display objects might be scaled.



Implementation
    public function get height():int

Throws
Error — If the file is not downloaded sufficiently to retrieve the requested information.

isURLInaccessible

property 
isURLInaccessible:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10.1, AIR 2

Indicates if the LoaderInfo.url property has been truncated. When the isURLInaccessible value is true the LoaderInfo.url value is only the domain of the final URL from which the content loaded. For example, the property is truncated if the content is loaded from http://www.adobe.com/assets/hello.swf, and the LoaderInfo.url property has the value http://www.adobe.com. The isURLInaccessible value is true only when all of the following are also true:

  • An HTTP redirect occurred while loading the content.
  • The SWF file calling Loader.load() is from a different domain than the content's final URL.
  • The SWF file calling Loader.load() does not have permission to access the content. Permission is granted to access the content the same way permission is granted for BitmapData.draw(): call Security.allowDomain() to access a SWF file (or for non-SWF file content, establish a policy file and use the LoaderContext.checkPolicyFile property).

Note: The isURLInaccessible property was added for Flash Player 10.1 and AIR 2.0. However, this property is made available to SWF files of all versions when the Flash runtime supports it. So, using some authoring tools in "strict mode" causes a compilation error. To work around the error use the indirect syntax myLoaderInfo["isURLInaccessible"], or disable strict mode. If you are using Flash Professional CS5 or Flex SDK 4.1, you can use and compile this API for runtimes released before Flash Player 10.1 and AIR 2.

For application content in AIR, the value of this property is always false.



Implementation
    public function get isURLInaccessible():Boolean

Related API Elements

loader

property 
loader:Loader  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The Loader object associated with this LoaderInfo object. If this LoaderInfo object is the loaderInfo property of the instance of the main class of the SWF file, no Loader object is associated.



Implementation
    public function get loader():Loader

Throws
SecurityError — If the object accessing this API is prevented from accessing the Loader object because of security restrictions. This can occur, for instance, when a loaded SWF file attempts to access its loaderInfo.loader property and it is not granted security permission to access the loading SWF file.

For more information related to security, see the Flash Player Developer Center Topic: Security.

loaderURL

property 
loaderURL:String  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The URL of the SWF file that initiated the loading of the media described by this LoaderInfo object. For the instance of the main class of the SWF file, this URL is the same as the SWF file's own URL.



Implementation
    public function get loaderURL():String

parameters

property 
parameters:Object  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

An object that contains name-value pairs that represent the parameters provided to the loaded SWF file.

You can use a for-in loop to extract all the names and values from the parameters object.

The two sources of parameters are: the query string in the URL of the main SWF file, and the value of the FlashVars HTML parameter (this affects only the main SWF file).

The parameters property replaces the ActionScript 1.0 and 2.0 technique of providing SWF file parameters as properties of the main timeline.

The value of the parameters property is null for Loader objects that contain SWF files that use ActionScript 1.0 or 2.0. It is only non-null for Loader objects that contain SWF files that use ActionScript 3.0.



Implementation
    public function get parameters():Object

parentAllowsChild

property 
parentAllowsChild:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Expresses the trust relationship from Loader (parent) to the content (child). If the parent has allowed the child access, true; otherwise, false. This property is set to true if the parent object called the allowDomain() method to grant permission to the child domain or if a URL policy file is loaded at the parent domain granting permission to the child domain. If child and parent are in the same domain, this property is set to true.

For more information related to security, see the Flash Player Developer Center Topic: Security.



Implementation
    public function get parentAllowsChild():Boolean

Throws
Error — Thrown if the file is not downloaded sufficiently to retrieve the requested information.

parentSandboxBridge

property 
parentSandboxBridge:Object

Runtime Versions: AIR 1.0, Flash Player 11.4, Flash Lite 4

A object that can be set by code in the Loader object's sandbox to expose properties and methods that can be accessed by the loaded content's code. This sandbox bridge lets content from a non-application domain have controlled access to scripts in the application sandbox, and vice versa. The sandbox bridge serves as a gateway between the sandboxes, providing explicit interaction between application and non-application security sandboxes.



Implementation
    public function get parentSandboxBridge():Object
    public function set parentSandboxBridge(value:Object):void

Throws
SecurityError — Only content in the Loader object's sandbox can set this property.

Related API Elements

sameDomain

property 
sameDomain:Boolean  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Expresses the domain relationship between the loader and the content: true if they have the same origin domain; false otherwise.



Implementation
    public function get sameDomain():Boolean

Throws
Error — Thrown if the file is not downloaded sufficiently to retrieve the requested information.

sharedEvents

property 
sharedEvents:EventDispatcher  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

An EventDispatcher instance that can be used to exchange events across security boundaries. Even when the Loader object and the loaded content originate from security domains that do not trust one another, both can access sharedEvents and send and receive events via this object.



Implementation
    public function get sharedEvents():EventDispatcher

swfVersion

property 
swfVersion:uint  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The file format version of the loaded SWF file. The file format is specified using the enumerations in the SWFVersion class, such as SWFVersion.FLASH7 and SWFVersion.FLASH9.



Implementation
    public function get swfVersion():uint

Throws
Error — If the file is not downloaded sufficiently to retrieve the requested information.
 
Error — If the file is not a SWF file.

Related API Elements

uncaughtErrorEvents

property 
uncaughtErrorEvents:UncaughtErrorEvents  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10.1, AIR 2

An object that dispatches an uncaughtError event when an unhandled error occurs in code in this LoaderInfo object's SWF file. An uncaught error happens when an error is thrown outside of any try..catch blocks or when an ErrorEvent object is dispatched with no registered listeners.

For example, if in a try block, there is an event dispatcher that calls its event handler, the catch block doesn't catch the error if thrown in event handler. Any error thrown thereafter can be caught by listening to LoaderInfo.uncaughtErrorEvents

This property is created when the SWF associated with this LoaderInfo has finished loading. Until then the uncaughtErrorEvents property is null. In an ActionScript-only project, you can access this property during or after the execution of the constructor function of the main class of the SWF file. For a Flex project, the uncaughtErrorEvents property is available after the applicationComplete event is dispatched.



Implementation
    public function get uncaughtErrorEvents():UncaughtErrorEvents

Related API Elements


Example  ( How to use this example )
The following example demonstrates the use of an uncaught error event handler to detect uncaught errors in an ActionScript project. The example defines an uncaughtError event handler to detect uncaught errors. It also provides a button that, when clicked, throws an error that is caught by the uncaught error handler.

In the constructor, the code registers a listener for the uncaughtError event dispatched by the LoaderInfo object's uncaughtErrorEvents property.

In the uncaughtErrorHandler() method, the code checks the data type of the error property and responds accordingly.

package
{
    import flash.display.Sprite;
    import flash.events.ErrorEvent;
    import flash.events.MouseEvent;
    import flash.events.UncaughtErrorEvent;

    public class UncaughtErrorEventExample extends Sprite
    {
        public function UncaughtErrorEventExample()
        {
            loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);
            
            drawUI();
        }
        
        private function uncaughtErrorHandler(event:UncaughtErrorEvent):void
        {
            if (event.error is Error)
            {
                var error:Error = event.error as Error;
                // do something with the error
            }
            else if (event.error is ErrorEvent)
            {
                var errorEvent:ErrorEvent = event.error as ErrorEvent;
                // do something with the error
            }
            else
            {
                // a non-Error, non-ErrorEvent type was thrown and uncaught
            }
        }
        
        private function drawUI():void
        {
            var btn:Sprite = new Sprite();
            btn.graphics.clear();
            btn.graphics.beginFill(0xFFCC00);
            btn.graphics.drawRect(0, 0, 100, 50);
            btn.graphics.endFill();
            addChild(btn);
            btn.addEventListener(MouseEvent.CLICK, clickHandler);
        }
        
        private function clickHandler(event:MouseEvent):void
        {
            throw new Error("Gak!");
        }
    }
}


The following example is the Flex equivalent of the previous example, using an MXML document instead of an ActionScript class as the root content.
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/halo"
                       applicationComplete="applicationCompleteHandler();">
    
    <fx:Script>
        <![CDATA[
            import flash.events.ErrorEvent;
            import flash.events.MouseEvent;
            import flash.events.UncaughtErrorEvent;
            
            private function applicationCompleteHandler():void
            {
                loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);
            }
    
            private function uncaughtErrorHandler(event:UncaughtErrorEvent):void
            {
                if (event.error is Error)
                {
                    var error:Error = event.error as Error;
                    // do something with the error
                }
                else if (event.error is ErrorEvent)
                {
                    var errorEvent:ErrorEvent = event.error as ErrorEvent;
                    // do something with the error
                }
                else
                {
                    // a non-Error, non-ErrorEvent type was thrown and uncaught
                }
            }
            
            private function clickHandler(event:MouseEvent):void
            {
                throw new Error("Gak!");
            }
        ]]>
    </fx:Script>
      
    <s:Button label="Cause Error" click="clickHandler(event);"/>
</s:WindowedApplication>

url

property 
url:String  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

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.



Implementation
    public function get url():String

Related API Elements

width

property 
width:int  [read-only]

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

The nominal width of the loaded content. This value might differ from the actual width at which the content is displayed, since the loaded content or its parent display objects might be scaled.



Implementation
    public function get width():int

Throws
Error — If the file is not downloaded sufficiently to retrieve the requested information.
Method Detail

getLoaderInfoByDefinition

()method
public static function getLoaderInfoByDefinition(object:Object):LoaderInfo

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9.0.115.0, Flash Lite 4

Returns the LoaderInfo object associated with a SWF file defined as an object.

Parameters

object:Object — The object for which you want to get an associated LoaderInfo object.

Returns
LoaderInfo — The associated LoaderInfo object. Returns null when called in non-debugger builds (or when debugging is not enabled) or if the referenced object does not have an associated LoaderInfo object (such as some objects used by the AIR runtime).

Throws
SecurityError — The caller is not running in the local trusted sandbox.
Event Detail

complete

Event
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.COMPLETE

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Dispatched when data has loaded successfully. In other words, it is dispatched when all the content has been downloaded and the loading has finished. The complete event is always dispatched after the init event. The init event is dispatched when the object is ready to access, though the content may still be downloading.

The Event.COMPLETE constant defines the value of the type property of a complete event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object that has completed loading.

Related API Elements

httpStatus

Event  
Event Object Type: flash.events.HTTPStatusEvent
property HTTPStatusEvent.type = flash.events.HTTPStatusEvent.HTTP_STATUS

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Dispatched when a network request is made over HTTP and an HTTP status code can be detected.

The HTTPStatusEvent.HTTP_STATUS constant defines the value of the type property of a httpStatus event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
statusThe HTTP status code returned by the server.
targetThe network object receiving an HTTP status code.

Related API Elements

init

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.INIT

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Dispatched when the properties and methods of a loaded SWF file are accessible and ready for use. The content, however, can still be downloading. A LoaderInfo object dispatches the init event when the following conditions exist:

  • All properties and methods associated with the loaded object and those associated with the LoaderInfo object are accessible.
  • The constructors for all child objects have completed.
  • All ActionScript code in the first frame of the loaded SWF's main timeline has been executed.

For example, an Event.INIT is dispatched when the first frame of a movie or animation is loaded. The movie is then accessible and can be added to the display list. The complete movie, however, can take longer to download. The Event.COMPLETE is only dispatched once the full movie is loaded.

The init event always precedes the complete event.

The Event.INIT constant defines the value of the type property of an init event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe LoaderInfo object associated with the SWF file being loaded.

Related API Elements

ioError

Event  
Event Object Type: flash.events.IOErrorEvent
property IOErrorEvent.type = flash.events.IOErrorEvent.IO_ERROR

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Dispatched when an input or output error occurs that causes a load operation to fail.

Defines the value of the type property of an ioError event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
errorIDA reference number associated with the specific error (AIR only).
targetThe network object experiencing the input/output error.
textText to be displayed as an error message.

Related API Elements

open

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.OPEN

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Dispatched when a load operation starts.

The Event.OPEN constant defines the value of the type property of an open event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object that has opened a connection.

Related API Elements

progress

Event  
Event Object Type: flash.events.ProgressEvent
property ProgressEvent.type = flash.events.ProgressEvent.PROGRESS

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Dispatched when data is received as the download operation progresses.

Defines the value of the type property of a progress event object.

This event has the following properties:

PropertyValue
bubblesfalse
bytesLoadedThe number of items or bytes loaded at the time the listener processes the event.
bytesTotalThe total number of items or bytes that ultimately will be loaded if the loading process succeeds.
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object reporting progress.

Related API Elements

unload

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.UNLOAD

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 9, Flash Lite 4

Dispatched by a LoaderInfo object whenever a loaded object is removed by using the unload() method of the Loader object, or when a second load is performed by the same Loader object and the original content is removed prior to the load beginning.

The Event.UNLOAD constant defines the value of the type property of an unload event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe LoaderInfo object associated with the SWF file being unloaded or replaced.

Related API Elements

LoaderInfoExample.as

The following example uses the LoaderInfoExample class to display an image on the stage. This is accomplished by performing the following steps:
  1. A property url is created, which is the location and name of the image.
  2. The class constructor creates a Loader object named loader.
  3. The loader object instantiates an event listener to ensure that the image loads properly.
  4. The constructor creates a new instance of a URLRequest object, request, with url passed so that the file name and location are known.
  5. The request object is then passed to the load() method of the loader object, which loads the image onto the display list.

Important: This example requires that you add a file named Image.gif in the same directory as the compiled SWF file. Use an image that has an area that fits within the dimensions of the main SWF file.

package {
    import flash.display.Loader;
    import flash.display.LoaderInfo;
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.URLRequest;

    public class LoaderInfoExample extends Sprite {
        private var url:String = "Image.gif";

        public function LoaderInfoExample() {
            var loader:Loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
            loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            var request:URLRequest = new URLRequest(url);
            loader.load(request);
            addChild(loader);
        }

        private function initHandler(event:Event):void {
            var loader:Loader = Loader(event.target.loader);
            var info:LoaderInfo = LoaderInfo(loader.contentLoaderInfo);
            trace("initHandler: loaderURL=" + info.loaderURL + " url=" + info.url);
        }

        private function ioErrorHandler(event:IOErrorEvent):void {
            trace("ioErrorHandler: " + event);
        }
    }
}