適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隱藏篩選
flash.display 

LoaderInfo  - AS3

套件x

最上層
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

語言元素

全域常數
全域函數
運算子
陳述式、關鍵字和指令
特殊類型

附錄

新增內容
編譯器錯誤
編譯器警告
執行階段錯誤
移轉至 ActionScript 3
支援的字元集
僅限 MXML 標籤
移動 XML 元素
Timed Text 標籤
不建議元素清單
AccessibilityImplementation 常數
如何使用 ActionScript 範例
法律聲明
套件flash.display
類別public class LoaderInfo
繼承LoaderInfo Inheritance EventDispatcher Inheritance Object

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

LoaderInfo 類別會提供有關載入的 SWF 檔案或影像檔 (JPEG、GIF 或 PNG) 的資訊。 任何顯示物件都可以使用 LoaderInfo 物件。 提供的資訊包括載入進度、載入器的 URL 與載入內容、媒體總位元組數,以及媒體的表面高度和寬度。

您可以使用兩種方法存取 LoaderInfo 物件:

  • flash.display.Loader 物件的 contentLoaderInfo 屬性 -- 任何 Loader 物件永遠都可以使用 contentLoaderInfo 屬性。 至於尚未呼叫 load()loadBytes() 方法的 Loader 物件,或尚未完全載入的 Loader 物件,嘗試存取 contentLoaderInfo 屬性的眾多屬性會擲出錯誤。
  • 顯示物件的 loaderInfo 屬性。

Loader 物件的 contentLoaderInfo 屬性會提供 Loader 物件正在載入的內容相關資訊,而 DisplayObject 的 loaderInfo 屬性則會提供該顯示物件之根 SWF 檔案的相關資訊。

當您使用 Loader 物件來載入顯示物件 (如 SWF 檔或點陣圖) 時,顯示物件的 loaderInfo 屬性與 Loader 物件 (DisplayObject.loaderInfo = Loader.contentLoaderInfo) 的 contentLoaderInfo 屬性相同。由於 SWF 檔的主要類別實體不具有 Loader 物件,loaderInfo 屬性就變成了存取 SWF 檔之主要類別實體的 LoaderInfo 時,唯一的方式。

下圖顯示 LoaderInfo 物件的不同用途 -- 分別針對 SWF 檔的主要類別實體、Loader 物件的 contentLoaderInfo 屬性,以及針對載入物件的 loaderInfo 屬性:

不同 LoaderInfo 情況的影像

當載入作業尚未完成時,將無法使用 Loader 物件之 contentLoaderInfo 屬性當中的某些屬性。 您可以取得一些屬性,例如 bytesLoadedbytesTotalurlloaderURL,以及 applicationDomain。 當 loaderInfo 物件傳送 init 事件,您可以存取 loaderInfo 物件的所有屬性以及載入的影像或 SWF 檔案。

注意:LoaderInfo 物件的所有屬性都是唯讀的。

EventDispatcher.dispatchEvent() 方法不適用於 LoaderInfo 物件。 如果您在 LoaderInfo 物件呼叫 dispatchEvent(),會擲出 IllegalOperationError 例外。

檢視範例

相關 API 元素



公用屬性
 屬性定義自
  actionScriptVersion : uint
[唯讀] 載入的 SWF 檔之 ActionScript 版本。
LoaderInfo
  applicationDomain : ApplicationDomain
[唯讀] 當載入外部 SWF 檔時,所有包含在載入類別的 ActionScript 3.0 定義都會儲存在 applicationDomain 屬性中。
LoaderInfo
  bytes : ByteArray
[唯讀] 與 LoaderInfo 物件相關聯的位元組。
LoaderInfo
  bytesLoaded : uint
[唯讀] 媒體所載入的位元組數。
LoaderInfo
  bytesTotal : uint
[唯讀] 整個媒體檔的壓縮位元組數。
LoaderInfo
  childAllowsParent : Boolean
[唯讀] 傳達內容 (子系) 對載入器 (父輩) 的信任關係。
LoaderInfo
  childSandboxBridge : Object
物件,可以由載入之內容的程式碼設定,以顯露屬性和方法供 Loader 物件之安全執行程序中的程式碼存取。
LoaderInfo
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
  content : DisplayObject
[唯讀] 與此 LoaderInfo 物件相關聯的載入物件。
LoaderInfo
  contentType : String
[唯讀] 載入檔案的 MIME 類型。
LoaderInfo
  frameRate : Number
[唯讀] 載入的 SWF 檔之名目影格速率,以每秒影格數來定義。
LoaderInfo
  height : int
[唯讀] 載入檔案的名目高度。
LoaderInfo
  isURLInaccessible : Boolean
[唯讀] 指出 LoaderInfo.url 屬性是否曾被截斷。
LoaderInfo
  loader : Loader
[唯讀] 與此 LoaderInfo 物件相關聯的 Loader 物件。
LoaderInfo
  loaderURL : String
[唯讀] 針對這個 LoaderInfo 物件所描述的媒體,負責將其載入作業初始化的 SWF 檔案之 URL。
LoaderInfo
  parameters : Object
[唯讀] 包含名稱/數值配對的物件,可代表提供給載入之 SWF 檔案的參數。
LoaderInfo
  parentAllowsChild : Boolean
[唯讀] 傳達 Loader (父輩) 對內容 (子系) 的信任關係。
LoaderInfo
  parentSandboxBridge : Object
物件,可以透過程式碼在 Loader 物件之安全執行程序中設定,以顯露屬性和方法供所載入之內容的程式碼存取。
LoaderInfo
  sameDomain : Boolean
[唯讀] 傳達載入器與內容之間的關係: 如果它們來自相同的原始網域則為 true;否則為 false。
LoaderInfo
  sharedEvents : EventDispatcher
[唯讀] EventDispatcher 實體,可用來交換各安全性邊界之間的事件。
LoaderInfo
  swfVersion : uint
[唯讀] 載入的 SWF 檔之檔案格式版本。
LoaderInfo
  uncaughtErrorEvents : UncaughtErrorEvents
[唯讀] 是一個物件,當這個 LoaderInfo 物件之 SWF 檔案的程式碼發生未處理的錯誤時,這個物件就會傳送 uncaughtError 事件。
LoaderInfo
  url : String
[唯讀] 要載入的媒體 URL。
LoaderInfo
  width : int
[唯讀] 載入內容的名目寬度。
LoaderInfo
公用方法
 方法定義自
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。
EventDispatcher
  
[靜態] 傳回與 SWF 檔 (定義為物件) 相關聯的 LoaderInfo 物件。
LoaderInfo
 Inherited
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。
EventDispatcher
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
會從 EventDispatcher 物件移除偵聽程式。
EventDispatcher
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
 Inherited
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。
EventDispatcher
事件
 事件 摘要 定義自
 Inherited[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。EventDispatcher
  在順利載入資料時傳送。LoaderInfo
 Inherited[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。EventDispatcher
  當透過 HTTP 發出網路要求並可以偵測到 HTTP 狀態碼時傳送。LoaderInfo
  當載入的 SWF 檔的屬性和方法可供存取使用時傳送。LoaderInfo
  當發生輸入或輸出錯誤而導致載入作業失敗時傳送。LoaderInfo
  在載入作業開始時傳送。LoaderInfo
  在下載作業進行中收到資料時傳送。LoaderInfo
  每當使用 Loader 物件的 unload() 方法移除載入的物件,或是使用相同的 Loader 物件執行第二次載入並在載入開始之前移除原始內容時,由 LoaderInfo 物件傳送。LoaderInfo
屬性詳細資訊

actionScriptVersion

屬性
actionScriptVersion:uint  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

載入的 SWF 檔之 ActionScript 版本。 您可以使用 ActionScriptVersion 類別中的列舉項目來指定語言版本,例如 ActionScriptVersion.ACTIONSCRIPT2ActionScriptVersion.ACTIONSCRIPT3

注意:此屬性永遠具有 ActionScriptVersion.ACTIONSCRIPT2ActionScriptVersion.ACTIONSCRIPT3 的值。 ActionScript 1.0 和 2.0 都會回報為 ActionScriptVersion.ACTIONSCRIPT2 (版本 2.0)。 此屬性只能區別出 ActionScript 3.0 與 ActionScript 1.0 和 2.0。



實作
    public function get actionScriptVersion():uint

擲回值
Error — 如果檔案沒有完全下載以擷取要求的資訊。
 
Error — 如果檔案不是 SWF 檔。

相關 API 元素

applicationDomain

屬性 
applicationDomain:ApplicationDomain  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

當載入外部 SWF 檔時,所有包含在載入類別的 ActionScript 3.0 定義都會儲存在 applicationDomain 屬性中。

SWF 檔中的所有程式碼,都是為了存在於應用程式網域中而定義。 目前的應用程式網域也就是您的主應用程式的執行位置。 系統網域包含所有的應用程式網域,其中包括目前的網域以及 Flash Player 或 Adobe AIR 所使用的全部類別。

所有的應用程式網域,除了系統網域之外,都具有相關的父網域。 主要應用程式之 applicationDomain 的父網域就是系統網域。 只有在其父輩尚未定義載入的類別時,這些類別才會獲得定義。 因此,您不能以較新的定義覆寫載入類別的定義。

如需應用程式網域的使用範例,請參閱「ActionScript 3.0 開發人員指南」中的「用戶端系統環境」一章。



實作
    public function get applicationDomain():ApplicationDomain

擲回值
SecurityError — 呼叫者的安全執行程序無法獲得允許來存取此 ApplicationDomain。

相關 API 元素

bytes

屬性 
bytes:ByteArray  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9.0.115.0, Flash Lite 4

與 LoaderInfo 物件相關聯的位元組。



實作
    public function get bytes():ByteArray

擲回值
SecurityError — 如果存取此 API 的物件因為安全性限制而被禁止存取載入物件。 這個情況就像,當 Loader 物件嘗試存取 contentLoaderInfo.content 屬性,由於沒有取得安全性權限而無法存取載入的內容。

如需安全性詳細資訊,請參閱「Flash Player 開發人員中心」主題:安全性

bytesLoaded

屬性 
bytesLoaded:uint  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

媒體所載入的位元組數。 當此數等於 bytesTotal 值,就會載入所有位元組。



實作
    public function get bytesLoaded():uint

bytesTotal

屬性 
bytesTotal:uint  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

整個媒體檔的壓縮位元組數。

在此 LoaderInfo 物件的相對應 Loader 物件傳送第一個 progress 事件之前,bytesTotal 為 0。 在 Loader 物件傳送了 progress 事件之後,bytesTotal 就會反映要下載的實際位元組數。

注意 (僅 iOS):在 iOS 上執行應用程式時,傳回的值與其他平台上的不同。



實作
    public function get bytesTotal():uint

相關 API 元素

childAllowsParent

屬性 
childAllowsParent:Boolean  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

傳達內容 (子系) 對載入器 (父輩) 的信任關係。 如果子系允許父輩存取,則為 true;否則為 false。 如果子物件已經呼叫 allowDomain() 方法授與父網域權限,或者子網域已經載入授與父網域權限的 URL 原則,則此屬性會設為 true。如果子系與父輩都位於相同的網域,則此屬性會設為 true

如需安全性詳細資訊,請參閱「Flash Player 開發人員中心」主題:安全性



實作
    public function get childAllowsParent():Boolean

擲回值
Error — 如果檔案未完全下載即擷取要求的資訊,則會擲出事件。

childSandboxBridge

屬性 
childSandboxBridge:Object

執行階段版本: AIR 1.0, Flash Player 11.4, Flash Lite 4

物件,可以由載入之內容的程式碼設定,以顯露屬性和方法供 Loader 物件之安全執行程序中的程式碼存取。此「安全執行程序橋接」可讓來自非應用程式網域的內容控制存取權限,以編寫應用程式安全執行程序中的指令碼,反之亦然。此安全執行程序橋接的作用是做為多個安全執行程序之間的閘道,可提供應用程式和非應用程式安全執行程序之間明確的互動。



實作
    public function get childSandboxBridge():Object
    public function set childSandboxBridge(value:Object):void

擲回值
SecurityError — 只有載入之內容的安全執行程序可以存取此屬性。

相關 API 元素

content

屬性 
content:DisplayObject  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

與此 LoaderInfo 物件相關聯的載入物件。



實作
    public function get content():DisplayObject

擲回值
SecurityError — 如果存取此 API 的物件因為安全性限制而被禁止存取載入物件。 這個情況就像,當 Loader 物件嘗試存取 contentLoaderInfo.content 屬性,由於沒有取得安全性權限而無法存取載入的內容。

如需安全性詳細資訊,請參閱「Flash Player 開發人員中心」主題:安全性

contentType

屬性 
contentType:String  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

載入檔案的 MIME 類型。 如果未完全載入檔案以判斷類型的話,數值將為 null。以下清單列出可能的值:

  • "application/x-shockwave-flash"
  • "image/jpeg"
  • "image/gif"
  • "image/png"



實作
    public function get contentType():String

frameRate

屬性 
frameRate:Number  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

載入的 SWF 檔之名目影格速率,以每秒影格數來定義。 雖然此數通常是整數型態,但不必然是整數。

此數值可能與實際使用的影格速率相異。 在任何時候,Flash Player 或 Adobe AIR 每一次只會在所有載入的 SWF 檔案上使用一個影格速率,而且這個影格速率將由主要 SWF 檔案的名目影格速率所決定。此外,視硬體、音效同步化和其它因素而定,可能無法達到主要影格速率。



實作
    public function get frameRate():Number

擲回值
Error — 如果檔案沒有完全下載以擷取要求的資訊。
 
Error — 如果檔案不是 SWF 檔。

height

屬性 
height:int  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

載入檔案的名目高度。 此值可能與顯示內容的實際高度相異,因為載入內容或其上層顯示物件可能已經縮放過了。



實作
    public function get height():int

擲回值
Error — 如果檔案沒有完全下載以擷取要求的資訊。

isURLInaccessible

屬性 
isURLInaccessible:Boolean  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10.1, AIR 2

指出 LoaderInfo.url 屬性是否曾被截斷。當 isURLInaccessible 值為 true 時,LoaderInfo.url 值便只是載入內容之最終 URL 的網域。例如,如果從 http://www.adobe.com/assets/hello.swf 載入內容,而 LoaderInfo.url 屬性的值為 http://www.adobe.com,屬性便會被截斷。只有下列項目都為 true 時,isURLInaccessible 值才會為 true

  • 載入內容過程中,發生 HTTP 重新導向。
  • 呼叫 Loader.load() 的 SWF 檔案是來自內容最終 URL 以外的網域。
  • 呼叫 Loader.load() 的 SWF 檔案沒有存取內容的權限。授與存取內容權限的方式,和授與 BitmapData.draw() 權限的方式一樣:都是呼叫 Security.allowDomain() 來存取 SWF 檔案 (對於非 SWF 檔案內容,則是建立原則檔案,並使用 LoaderContext.checkPolicyFile 屬性)。

注意:isURLInaccessible 屬性是 Flash Player 10.1 及 AIR 2.0 新增的屬性。不過當 Flash 執行階段支援它時,所有版本的 SWF 檔案都可以使用這個屬性。所以在「嚴謹模式」中使用某些編寫工具會造成編譯錯誤。若要解決錯誤,請使用間接語法 myLoaderInfo["isURLInaccessible"] 或停用嚴謹模式。如果您使用 Flash Professional CS5 或 Flex SDK 4.1,您可以使用及編譯此 API,供 Flash Player 10.1 及 AIR 2 之前的執行階段版本使用。

對於 AIR 中的應用程式內容,這個屬性的值永遠都是 false



實作
    public function get isURLInaccessible():Boolean

相關 API 元素

loader

屬性 
loader:Loader  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

與此 LoaderInfo 物件相關聯的 Loader 物件。 如果這個 LoaderInfo 物件是 SWF 檔案主要類別實體的 loaderInfo 屬性,則不會關聯任何 Loader 物件。



實作
    public function get loader():Loader

擲回值
SecurityError — 如果存取此 API 的物件因為安全性限制而被禁止存取 Loader 物件。 這個情況就像,當載入的 SWF 檔案嘗試存取其 loaderInfo.loader 屬性,由於沒有取得安全性權限而無法存取載入的 SWF 檔案。

如需安全性詳細資訊,請參閱「Flash Player 開發人員中心」主題:安全性

loaderURL

屬性 
loaderURL:String  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

針對這個 LoaderInfo 物件所描述的媒體,負責將其載入作業初始化的 SWF 檔案之 URL。 至於 SWF 檔案的主要類別實體,此 URL 與 SWF 檔案自身的 URL 是一樣的。



實作
    public function get loaderURL():String

parameters

屬性 
parameters:Object  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

包含名稱/數值配對的物件,可代表提供給載入之 SWF 檔案的參數。

您可以使用 for-in 迴圈,將所有名稱與數值從 parameters 物件中擷取出來。

兩個參數來源為:主要 SWF 檔之 URL 的查詢字串,以及 FlashVars HTML 參數值 (只會影響主要 SWF 檔)。

parameters 屬性會取代 ActionScript 1.0 與 2.0 做為主要時間軸屬性提供給 SWF 檔案參數使用的功能。

包含運用 ActionScript 1.0 或 2.0 的 SWF 檔,其 Loader 物件的 parameters 屬性值為 null。 只有當 Loader 物件所包含的 SWF 檔使用的是 ActionScript 3.0,其屬性值才不會是 null。



實作
    public function get parameters():Object

parentAllowsChild

屬性 
parentAllowsChild:Boolean  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

傳達 Loader (父輩) 對內容 (子系) 的信任關係。 如果父輩允許子系存取,則為 true;否則為 false。 如果父物件已經呼叫 allowDomain() 方法授與子網域權限,或者父網域已經載入授與子網域權限的 URL 原則檔,則此屬性會設為 true。如果子系與父輩都位於相同的網域,則此屬性會設為 true

如需安全性詳細資訊,請參閱「Flash Player 開發人員中心」主題:安全性



實作
    public function get parentAllowsChild():Boolean

擲回值
Error — 如果檔案未完全下載即擷取要求的資訊,則會擲出事件。

parentSandboxBridge

屬性 
parentSandboxBridge:Object

執行階段版本: AIR 1.0, Flash Player 11.4, Flash Lite 4

物件,可以透過程式碼在 Loader 物件之安全執行程序中設定,以顯露屬性和方法供所載入之內容的程式碼存取。此「安全執行程序橋接」可讓來自非應用程式網域的內容控制存取權限,以編寫應用程式安全執行程序中的指令碼,反之亦然。此安全執行程序橋接的作用是做為多個安全執行程序之間的閘道,可提供應用程式和非應用程式安全執行程序之間明確的互動。



實作
    public function get parentSandboxBridge():Object
    public function set parentSandboxBridge(value:Object):void

擲回值
SecurityError — 只有 Loader 物件之安全執行程序中的內容可以存取此屬性。

相關 API 元素

sameDomain

屬性 
sameDomain:Boolean  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

傳達載入器與內容之間的關係:true,如果它們來自相同的原始網域;否則為 false



實作
    public function get sameDomain():Boolean

擲回值
Error — 如果檔案未完全下載即擷取要求的資訊,則會擲出事件。

sharedEvents

屬性 
sharedEvents:EventDispatcher  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

EventDispatcher 實體,可用來交換各安全性邊界之間的事件。 即使當 Loader 物件和所載入的內容都是來自安全性網域 (彼此互不信任的網域) 時,兩者還是可以存取 sharedEvents 並透過此物件傳送和接收事件。



實作
    public function get sharedEvents():EventDispatcher

swfVersion

屬性 
swfVersion:uint  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

載入的 SWF 檔之檔案格式版本。 您可以使用 SWFVersion 類別中的列舉項目來指定檔案格式,例如 SWFVersion.FLASH7SWFVersion.FLASH9



實作
    public function get swfVersion():uint

擲回值
Error — 如果檔案沒有完全下載以擷取要求的資訊。
 
Error — 如果檔案不是 SWF 檔。

相關 API 元素

uncaughtErrorEvents

屬性 
uncaughtErrorEvents:UncaughtErrorEvents  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10.1, AIR 2

是一個物件,當這個 LoaderInfo 物件之 SWF 檔案的程式碼發生未處理的錯誤時,這個物件就會傳送 uncaughtError 事件。在任何 try..catch 區塊外面發生錯誤時,或傳送的 ErrorEvent 物件沒有註冊偵聽程式時,就會發生未捕捉到的錯誤。

例如,若在 try 區塊中,則會有呼叫其事件處理常式的事件發送程式,而且 catch 區塊不會捕捉以事件處理常式擲回的錯誤。透過偵聽 LoaderInfo.uncaughtErrorEvents 可以捕捉之後擲回的任何錯誤。

當此 LoaderInfo 相關的 SWF 載入完成之後,就會建立這個屬性。直到 uncaughtErrorEvents 屬性變成 null 為止。在僅有 ActionScript 的專案中,您可以在執行 SWF 檔案主要類別的建構函數期間或之後存取此屬性。對於 Flex 專案,傳送 applicationComplete 事件之後,就可以取得 uncaughtErrorEvents 屬性。



實作
    public function get uncaughtErrorEvents():UncaughtErrorEvents

相關 API 元素


範例  ( 如何使用本範例 )
以下範例示範如何使用未捕捉到的錯誤事件處理常式,在 ActionScript 專案中偵測未捕捉到的錯誤。這個範例會定義 uncaughtError 事件處理常式來偵測未捕捉到的錯誤。它也會提供一個按鈕,只要按一下,就會擲回一個由未捕捉到的錯誤處理常式所捕捉到的錯誤。

在建構函式中,程式碼會為 LoaderInfo 物件的 uncaughtErrorEvents 屬性所傳送的 uncaughtError 事件註冊一個偵聽程式。

uncaughtErrorHandler() 方法中,程式碼會檢查 error 屬性的資料類型,並視情況提供適當的回應。

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!");
        }
    }
}


以下範例使用 Flex,得到與前一個範例相同的效果。它使用 MXML 文件取代 ActionScript 類別,做為根內容。
<?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

屬性 
url:String  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

要載入的媒體 URL。

在這個 LoaderInfo 物件相對應的 Loader 物件傳送第一個 progress 事件之前,url 屬性值只能反映對 Loader 物件的 load() 方法呼叫中指定的初始 URL。 在第一個 progress 事件之後,url 屬性會在解析了任何重新導向作業與相關的 URL 之後,反映媒體的最終 URL。

在某些案例中,url 屬性的值會被截斷; 請參閱 isURLInaccessible 屬性,取得詳細資訊。



實作
    public function get url():String

相關 API 元素

width

屬性 
width:int  [唯讀]

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

載入內容的名目寬度。 此值可能與顯示內容的實際寬度相異,因為載入內容或其上層顯示物件可能已經縮放過了。



實作
    public function get width():int

擲回值
Error — 如果檔案沒有完全下載以擷取要求的資訊。
方法詳細資訊

getLoaderInfoByDefinition

()方法
public static function getLoaderInfoByDefinition(object:Object):LoaderInfo

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9.0.115.0, Flash Lite 4

傳回與 SWF 檔 (定義為物件) 相關聯的 LoaderInfo 物件。

參數

object:Object — 您要為其取得相關聯之 LoaderInfo 物件的物件。

傳回值
LoaderInfo — 相關聯的 LoaderInfo 物件。在除錯程式組建中呼叫時 (或未啟用除錯功能時) 或者如果所參考之 object 沒有相關聯的 LoaderInfo 物件 (例如 AIR 使用的某些物件),便會傳回 null

擲回值
SecurityError — 呼叫者並未在本機受信任的安全執行程序中執行。
事件詳細資訊

complete

事件
事件物件類型: flash.events.Event
屬性 Event.type = flash.events.Event.COMPLETE

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

在順利載入資料時傳送。 換句話說,它會在已經下載所有內容而且完成載入時傳送。complete 事件一定會在 init 事件之後傳送。在物件可供存取時會傳送 init 事件,儘管內容可能仍在下載中。

Event.COMPLETE 常數會定義 complete 事件物件的 type 屬性值。

這個事件具有下列屬性:

屬性
bubblesfalse
cancelablefalse;沒有要取消的預設行為指令。
currentTarget正主動使用事件偵聽程式處理 Event 物件的物件。
target已完成載入的網路物件。

相關 API 元素

httpStatus

事件  
事件物件類型: flash.events.HTTPStatusEvent
屬性 HTTPStatusEvent.type = flash.events.HTTPStatusEvent.HTTP_STATUS

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

當透過 HTTP 發出網路要求並可以偵測到 HTTP 狀態碼時傳送。

HTTPStatusEvent.HTTP_STATUS 常數會定義 httpStatus 事件物件的 type 屬性值。

這個事件具有下列屬性:

屬性
bubblesfalse
cancelablefalse;沒有要取消的預設行為指令。
currentTarget正主動使用事件偵聽程式處理 Event 物件的物件。
status伺服器傳回的 HTTP 狀態碼。
target接收 HTTP 狀態碼的網路物件。

相關 API 元素

init

事件  
事件物件類型: flash.events.Event
屬性 Event.type = flash.events.Event.INIT

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

當載入的 SWF 檔的屬性和方法可供存取使用時傳送。不過,內容可能仍在下載中。當下列條件存在時,LoaderInfo 物件會傳送 init 事件:

  • 所有與載入物件相關聯的屬性和方法,以及那些與 LoaderInfo 物件相關聯的屬性和方法都可以存取。
  • 所有子物件的建構函式都已完成。
  • 所載入 SWF 檔的主要時間軸的第一個影格中的所有 ActionScript 程式碼都已經執行。

例如,Event.INIT 會在影片或動畫的第一個影格載入時傳送。接著,影片便可供存取並可加入至顯示清單。不過,完整的影片會花較長的時間來下載。Event.COMPLETE 只會在已載入完整影片時傳送。

init 事件一定會在 complete 事件之前發生。

Event.INIT 常數會定義 init 事件物件的 type 屬性值。

這個事件具有下列屬性:

屬性
bubblesfalse
cancelablefalse;沒有要取消的預設行為指令。
currentTarget正主動使用事件偵聽程式處理 Event 物件的物件。
target與所載入之 SWF 檔相關聯的 LoaderInfo 物件。

相關 API 元素

ioError

事件  
事件物件類型: flash.events.IOErrorEvent
屬性 IOErrorEvent.type = flash.events.IOErrorEvent.IO_ERROR

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

當發生輸入或輸出錯誤而導致載入作業失敗時傳送。

定義 ioError 事件物件的 type 屬性值。

這個事件具有下列屬性:

屬性
bubblesfalse
cancelablefalse;沒有要取消的預設行為指令。
currentTarget正主動使用事件偵聽程式處理 Event 物件的物件。
errorID與特定錯誤相關聯的參考號碼 (僅限 AIR)。
target遭遇輸入/輸出錯誤的網路物件。
text要顯示為錯誤訊息的文字。

相關 API 元素

open

事件  
事件物件類型: flash.events.Event
屬性 Event.type = flash.events.Event.OPEN

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

在載入作業開始時傳送。

Event.OPEN 常數會定義 open 事件物件的 type 屬性值。

這個事件具有下列屬性:

屬性
bubblesfalse
cancelablefalse;沒有要取消的預設行為指令。
currentTarget正主動使用事件偵聽程式處理 Event 物件的物件。
target已開啟連線的網路物件。

相關 API 元素

progress

事件  
事件物件類型: flash.events.ProgressEvent
屬性 ProgressEvent.type = flash.events.ProgressEvent.PROGRESS

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

在下載作業進行中收到資料時傳送。

定義 progress 事件物件的 type 屬性值。

這個事件具有下列屬性:

屬性
bubblesfalse
bytesLoaded在偵聽程式處理事件時,載入的項目或位元組數目。
bytesTotal如果載入程序成功時,最終將載入的項目或位元組總數。
cancelablefalse;沒有要取消的預設行為指令。
currentTarget正主動使用事件偵聽程式處理 Event 物件的物件。
target回報進度的物件。

相關 API 元素

unload

事件  
事件物件類型: flash.events.Event
屬性 Event.type = flash.events.Event.UNLOAD

語言版本: ActionScript 3.0
執行階段版本: AIR 1.0, Flash Player 9, Flash Lite 4

每當使用 Loader 物件的 unload() 方法移除載入的物件,或是使用相同的 Loader 物件執行第二次載入並在載入開始之前移除原始內容時,由 LoaderInfo 物件傳送。

Event.UNLOAD 常數會定義 unload 事件物件的 type 屬性值。

這個事件具有下列屬性:

屬性
bubblesfalse
cancelablefalse;沒有要取消的預設行為指令。
currentTarget正主動使用事件偵聽程式處理 Event 物件的物件。
target與要取消載入或取代之 SWF 檔相關聯的 LoaderInfo 物件。

相關 API 元素

LoaderInfoExample.as

下列範例會使用 LoaderInfoExample 類別,以顯示舞台上的影像。 您可以執行下列步驟來完成這項工作:
  1. 會建立 url 屬性,此屬性將為影像的位置與名稱。
  2. 類別建構函式會建立一個物件,名為 loader
  3. loader 物件會將事件偵聽程式實體化,以確保影像正確載入。
  4. 建構函式會建立新的 URLRequest 物件實體 request,並傳遞 url 以便告知檔案名稱與位置。
  5. request 物件會傳遞至 loader 物件的 load() 方法,然後將影像載入顯示清單中。

重要:在此範例中,您需要將名為 Image.gif 的檔案加入與已編譯 SWF 檔案相同的目錄中。 使用的影像之影像區域必須與主要 SWF 檔的尺寸相符。

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);
        }
    }
}




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。