用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隐藏过滤条件
fl.containers 

UILoader  - AS3 Flash

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 的标签
Motion XML 元素
Timed Text 标记
不推荐使用的元素的列表
AccessibilityImplementation 常量
如何使用 ActionScript 示例
法律声明
fl.containers
public class UILoader
继承UILoader Inheritance UIComponent Inheritance Sprite Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

UILoader 类可让您设置要加载的内容,然后在运行时监视加载操作。 该类同时还处理已加载内容的大小调整。 如果从不同的域(沙箱)加载内容,可能由于安全原因导致内容属性不可访问。 有关详细信息,请参阅 ProLoader 类。

使用 ActionScript 设置 UILoader 类的属性将会覆盖在“属性”检查器或“组件”检查器中设置的同名参数。

该组件包装 fl.display.ProLoader。ProLoader 类处理所有的实际加载;UILoader 只提供 ProLoader 对象的可视显示。

注意:正在从不同的域或沙箱加载内容时,内容的属性可能会由于安全原因而无法访问。有关域安全如何影响加载过程的详细信息,请参阅“ProLoader 类”。

查看示例

相关 API 元素



公共属性
 属性由以下参数定义
 InheritedaccessibilityImplementation : AccessibilityImplementation
InteractiveObject 实例的当前辅助功能实现 (AccessibilityImplementation)。
InteractiveObject
 InheritedaccessibilityProperties : AccessibilityProperties
此显示对象的当前辅助功能选项。
DisplayObject
 Inheritedalpha : Number
表示指定对象的 Alpha 透明度值。
DisplayObject
  autoLoad : Boolean
获取或设置一个值,该值指示 UILoader 实例是否自动加载指定的内容。
UILoader
 InheritedblendMode : String
BlendMode 类中的一个值,用于指定要使用的混合模式。
DisplayObject
 InheritedblendShader : Shader
[只写] 设置用于混合前景和背景的着色器。
DisplayObject
 InheritedbuttonMode : Boolean
指定此 sprite 的按钮模式。
Sprite
  bytesLoaded : uint
[只读] 获取已加载的内容的字节数。
UILoader
  bytesTotal : uint
[只读] 获取要加载的内容的字节数。
UILoader
 InheritedcacheAsBitmap : Boolean
如果设置为 true,则 Flash 运行时将缓存显示对象的内部位图表示形式。
DisplayObject
 Inherited    cacheAsBitmapMatrix : Matrix
如果为非 null,则 Matrix 对象会定义显示对象在 cacheAsBitmap 设置为 true 时的呈现方式。
DisplayObject
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  content : DisplayObject
[只读] 包含使用 load() 方法或设置 source 属性加载的 SWF 文件或图像文件(JPEG、PNG 或 GIF 格式文件)的根显示对象。
UILoader
 InheritedcontextMenu : NativeMenu
指定与此对象相关联的上下文菜单。
InteractiveObject
 InheriteddoubleClickEnabled : Boolean
指定此对象是否接收 doubleClick 事件。
InteractiveObject
 InheriteddropTarget : DisplayObject
[只读] 指定拖动 sprite 时经过的显示对象,或放置 sprite 的显示对象。
Sprite
 Inheritedenabled : Boolean
获取或设置一个值,该值指示组件是否可以接受用户交互。
UIComponent
 Inheritedfilters : Array
包含当前与显示对象关联的每个滤镜对象的索引数组。
DisplayObject
 InheritedfocusEnabled : Boolean
获取或设置一个布尔值,该值指示组件是否可以在用户单击它后获得焦点。
UIComponent
 InheritedfocusManager : IFocusManager
获取或设置为此组件及其同级组件控制焦点的 FocusManager。
UIComponent
 InheritedfocusRect : Object
指定此对象是否显示焦点矩形。
InteractiveObject
 Inheritedgraphics : Graphics
[只读] 指定属于此 sprite 的 Graphics 对象,在此 sprite 中可执行矢量绘图命令。
Sprite
 Inheritedheight : Number
[覆盖] 获取或设置组件的高度,以像素为单位。
UIComponent
 InheritedhitArea : Sprite
指定一个 sprite 用作另一个 sprite 的点击区域。
Sprite
 InheritedloaderInfo : LoaderInfo
[只读] 返回一个 LoaderInfo 对象,其中包含加载此显示对象所属的文件的相关信息。
DisplayObject
  maintainAspectRatio : Boolean
获取或设置一个值,该值指示是要保持原始图像中使用的高宽比,还是要将图像的大小调整为 UILoader 组件的当前宽度和高度。
UILoader
 Inheritedmask : DisplayObject
调用显示对象被指定的 mask 对象遮罩。
DisplayObject
 InheritedmetaData : Object
如果元数据是通过 PlaceObject4 标记与此 DisplayObject 的实例一起存储在 SWF 文件中的,则获取 DisplayObject 实例的元数据对象。
DisplayObject
 InheritedmouseChildren : Boolean
确定对象的子级是否支持鼠标或用户输入设备。
DisplayObjectContainer
 InheritedmouseEnabled : Boolean
指定此对象是否接收鼠标或其他用户输入、消息。
InteractiveObject
 InheritedmouseFocusEnabled : Boolean
获取或设置一个值,该值指示组件是否可以在用户单击它后获得焦点。
UIComponent
 InheritedmouseX : Number
[只读] 表示此鼠标或用户输入设备位置的 x 坐标,以像素为单位。
DisplayObject
 InheritedmouseY : Number
[只读] 表示此鼠标或用户输入设备位置的 y 坐标,以像素为单位。
DisplayObject
 Inheritedname : String
表示 DisplayObject 的实例名称。
DisplayObject
 InheritedneedsSoftKeyboard : Boolean
指定当该 InteractiveObject 实例获得焦点时,是否显示虚拟键盘(显示在屏幕上的软键盘)。
InteractiveObject
 InheritednumChildren : int
[只读] 返回此对象的子项数目。
DisplayObjectContainer
 InheritedopaqueBackground : Object
指定显示对象是否由于具有某种背景颜色而不透明。
DisplayObject
 Inheritedparent : DisplayObjectContainer
[只读] 表示包含此显示对象的 DisplayObjectContainer 对象。
DisplayObject
  percentLoaded : Number
[只读] 获取一个范围在 0 到 100 之间的数字,指示已加载内容的百分比。
UILoader
 Inheritedroot : DisplayObject
[只读] 对于加载的 SWF 文件中的显示对象,root 属性是此 SWF 文件所表示的显示列表树结构部分中的顶级显示对象。
DisplayObject
 Inheritedrotation : Number
表示 DisplayObject 实例距其原始方向的旋转程度,以度为单位。
DisplayObject
 InheritedrotationX : Number
表示 DisplayObject 实例相对于 3D 父容器距离其原始方向的 x 轴旋转(以度为单位)。
DisplayObject
 InheritedrotationY : Number
表示 DisplayObject 实例相对于 3D 父容器距离其原始方向的 y 轴旋转(以度为单位)。
DisplayObject
 InheritedrotationZ : Number
表示 DisplayObject 实例相对于 3D 父容器距离其原始方向的 z 轴旋转(以度为单位)。
DisplayObject
 Inheritedscale9Grid : Rectangle
当前有效的缩放网格。
DisplayObject
  scaleContent : Boolean
获取或设置一个值,该值指示是否要将图像自动缩放到 UILoader 实例的大小。
UILoader
 InheritedscaleX : Number
[覆盖] 将组件的当前宽度与缩放系数相乘。
UIComponent
 InheritedscaleY : Number
[覆盖] 将组件的当前高度与缩放系数相乘。
UIComponent
 InheritedscaleZ : Number
表示从对象的注册点开始应用的对象的深度缩放比例(百分比)。
DisplayObject
 InheritedscrollRect : Rectangle
显示对象的滚动矩形范围。
DisplayObject
 Inherited    softKeyboard : String
控制软键盘的外观。
InteractiveObject
 InheritedsoftKeyboardInputAreaOfInterest : Rectangle
定义当显示软键盘时应在屏幕上保留的区域(在 iOS 上不支持)。
InteractiveObject
 InheritedsoundTransform : flash.media:SoundTransform
控制此 sprite 中的声音。
Sprite
  source : Object
获取或设置以下内容:绝对或相对 URL(该 URL 标识要加载的 SWF 或图像文件的位置)、库中影片剪辑的类名称、对显示对象的引用或者与组件位于同一层上的影片剪辑的实例名称。
UILoader
 Inheritedstage : Stage
[只读] 显示对象的舞台。
DisplayObject
 InheritedtabChildren : Boolean
确定对象的子项是否支持 Tab 键。
DisplayObjectContainer
 InheritedtabEnabled : Boolean
指定此对象是否遵循 Tab 键顺序。
InteractiveObject
 InheritedtabIndex : int
指定 SWF 文件中的对象按 Tab 键顺序排列。
InteractiveObject
 InheritedtextSnapshot : flash.text:TextSnapshot
[只读] 返回此 DisplayObjectContainer 实例的 TextSnapshot 对象。
DisplayObjectContainer
 Inheritedtransform : flash.geom:Transform
一个对象,具有与显示对象的矩阵、颜色转换和像素范围有关的属性。
DisplayObject
 InheriteduseHandCursor : Boolean
布尔值,表示当指针滑过 buttonMode 属性设置为 true 的 sprite 时是否显示指针手形(手形光标)。
Sprite
 Inheritedvisible : Boolean
[覆盖] 获取或设置一个值,该值指示当前组件实例是否可见。
UIComponent
 Inheritedwidth : Number
[覆盖] 获取或设置组件的宽度(以像素为单位)。
UIComponent
 Inheritedx : Number
[覆盖] 获取或设置 x 坐标,该坐标表示组件在其父容器内沿 x 轴的位置。
UIComponent
 Inheritedy : Number
[覆盖] 获取或设置 y 坐标,该坐标表示组件在其父容器内沿 y 轴的位置。
UIComponent
 Inheritedz : Number
表示 DisplayObject 实例相对于 3D 父容器沿 z 轴的 z 坐标位置。
DisplayObject
公共方法
 方法由以下参数定义
  
创建新的 UILoader 组件实例。
UILoader
 Inherited
将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。
DisplayObjectContainer
 Inherited
将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。
DisplayObjectContainer
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
 Inherited
表示安全限制是否会导致出现以下情况:在列表中忽略了使用指定 point 点调用 DisplayObjectContainer.getObjectsUnderPoint() 方法时返回的所有显示对象。
DisplayObjectContainer
 Inherited
删除此组件实例的样式属性。
UIComponent
  
取消当前正在对 ProLoader 实例执行的 load() 方法操作。
UILoader
 Inherited
确定指定显示对象是 DisplayObjectContainer 实例的子项还是该实例本身。
DisplayObjectContainer
 Inherited
将事件调度到事件流中。
EventDispatcher
 Inherited
在此组件上显示或隐藏焦点指示符。
UIComponent
 Inherited
启动立即绘制操作,但不像 invalidateNow 那样使全部设置失效。
UIComponent
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
返回一个矩形,该矩形定义相对于 targetCoordinateSpace 对象坐标系的显示对象区域。
DisplayObject
 Inherited
返回位于指定索引处的子显示对象实例。
DisplayObjectContainer
 Inherited
返回具有指定名称的子显示对象。
DisplayObjectContainer
 Inherited
返回 DisplayObject 的 child 实例的索引位置。
DisplayObjectContainer
 Inherited
检索当前具有焦点的对象。
UIComponent
 Inherited
返回对象的数组,这些对象位于指定点下,并且是该 DisplayObjectContainer 实例的子项(或孙子项,依此类推)。
DisplayObjectContainer
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
返回一个矩形,该矩形根据 targetCoordinateSpace 参数定义的坐标系定义显示对象的边界,但不包括形状上的任何笔触。
DisplayObject
 Inherited
检索组件的样式查找链中设置的样式属性。
UIComponent
  
[静态] 检索当前组件的默认样式映射。
UILoader
 Inherited
将 point 对象从舞台(全局)坐标转换为显示对象的(本地)坐标。
DisplayObject
 Inherited
将二维点从舞台(全局)坐标转换为三维显示对象的(本地)坐标。
DisplayObject
 Inherited
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
EventDispatcher
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
计算显示对象的边框,以确定它是否与 obj 显示对象的边框重叠或相交。
DisplayObject
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
计算显示对象,以确定它是否与 x 和 y 参数指定的点重叠或相交。
DisplayObject
 Inherited
invalidate(property:String, callLater:Boolean = true):void
在未另外指定的情况下,将属性标记为无效,并在下一帧上重绘组件。
UIComponent
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
  
load(request:URLRequest = null, context:LoaderContext = null):void
加载指定内容,或者,如果未指定内容,则加载 source 属性标识的位置的内容。
UILoader
  
loadBytes(bytes:ByteArray, context:LoaderContext = null):void
加载 ByteArray 对象中存储的二进制数据。
UILoader
 Inherited
将三维显示对象的(本地)坐标的三维点转换为舞台(全局)坐标中的二维点。
DisplayObject
 Inherited
将 point 对象从显示对象的(本地)坐标转换为舞台(全局)坐标。
DisplayObject
 Inherited
[静态] 将多个类的样式合并到一个对象中。
UIComponent
 Inherited
将组件移动到其父项内的指定位置。
UIComponent
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
从 DisplayObjectContainer 实例的子列表中删除指定的 child DisplayObject 实例。
DisplayObjectContainer
 Inherited
从 DisplayObjectContainer 的子列表中指定的 index 位置删除子 DisplayObject。
DisplayObjectContainer
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 0x7fffffff):void
从 DisplayObjectContainer 实例的子级列表中删除所有子 DisplayObject 实例。
DisplayObjectContainer
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
 Inherited
显示虚拟键盘。
InteractiveObject
 Inherited
更改现有子项在显示对象容器中的位置。
DisplayObjectContainer
 Inherited
设置此组件的焦点。
UIComponent
 Inherited
设置循环操作动态属性的可用性。
Object
  
[覆盖] 将组件调整为所要求的大小。
UILoader
 Inherited
setStyle(style:String, value:Object):void
对此组件实例设置样式属性。
UIComponent
 Inherited
startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
允许用户拖动指定的 Sprite。
Sprite
 Inherited
startTouchDrag(touchPointID:int, lockCenter:Boolean = false, bounds:Rectangle = null):void
使用户可以在启用触摸的设备上拖动指定的 Sprite。
Sprite
 Inherited
对源起于此对象的所有 MovieClip 递归停止时间轴执行。
DisplayObjectContainer
 Inherited
结束 startDrag() 方法。
Sprite
 Inherited
stopTouchDrag(touchPointID:int):void
结束 startTouchDrag() 方法,用于启用触摸的设备。
Sprite
 Inherited
交换两个指定子对象的 Z 轴顺序(从前到后顺序)。
DisplayObjectContainer
 Inherited
swapChildrenAt(index1:int, index2:int):void
在子级列表中两个指定的索引位置,交换子对象的 Z 轴顺序(前后顺序)。
DisplayObjectContainer
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
  
删除使用 load() 方法或 source 属性加载的此 UILoader 对象的子项。
UILoader
 Inherited
验证并更新此对象的属性和布局,如果需要的话重绘对象。
UIComponent
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。
EventDispatcher
受保护的方法
 方法由以下参数定义
 Inherited
参照在全局级别、组件级别和实例级别上设置的所有样式,为组件返回指定的样式。
UIComponent
事件
 事件 摘要 由以下参数定义
 Inherited[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。EventDispatcher
 Inherited将显示对象添加到显示列表中时调度。DisplayObject
 Inherited在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。DisplayObject
 Inherited当用户从文本上下文菜单中选择“清除”(或“删除”)时调度。InteractiveObject
 Inherited用户在同一 InteractiveObject 上按下并释放用户指针设备的主按钮时调度。InteractiveObject
  在内容加载完成时调度。UILoader
 Inherited
    contextMenu
当用户手势触发 AIR 应用程序中与此交互式对象相关联的上下文菜单时调度。InteractiveObject
 Inherited在用户为复制操作激活特定于平台的加速键组合或从文本上下文菜单中选择“复制”时调度。InteractiveObject
 Inherited在用户为剪切操作激活特定于平台的加速键组合或从文本上下文菜单中选择“剪切”时调度。InteractiveObject
 Inherited[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。EventDispatcher
 Inherited如果 InteractiveObject 的 doubleClickEnabled 标志设置为 true,当用户在该对象上快速连续按下两次并释放指针设备的主按钮时调度。InteractiveObject
 Inherited[播放事件] 播放头进入新帧时调度。DisplayObject
 Inherited[广播事件] 播放头退出当前帧时调度。DisplayObject
 Inherited显示对象获得焦点后调度。InteractiveObject
 Inherited显示对象失去焦点后调度。InteractiveObject
 Inherited[广播事件] 在帧显示对象的构造函数运行之后但在帧脚本运行之前调度。DisplayObject
 Inherited当用户使用 InteractiveObject 实例沿触摸面边缘创建接触点时调度(如在 Siri Remote for Apple TV 上沿触摸面边缘轻击)。有些设备也可能将这种接触解释为多个触摸事件的组合。InteractiveObject
 Inherited当用户在启用触摸设备上的同一 InteractiveObject 实例上按下两个接触点时(例如,在配有触摸屏的移动电话或平板电脑上的显示对象上按下和释放两个手指)调度。InteractiveObject
 Inherited当用户在启用触摸的设备上的 InteractiveObject 实例上移动接触点时(例如,在配有触摸屏的移动电话或平板电脑上的显示对象上从左向右移动手指)调度。InteractiveObject
 Inherited当用户在接触点处使用 InteractiveObject 实例执行旋转手势时(例如,将两个手指放在屏幕上,然后在配有触摸屏的移动电话或平板电脑上的显示对象上旋转这两个手指)调度。InteractiveObject
 Inherited当用户在接触点处使用 InteractiveObject 实例执行滑动手势(例如,在配有触摸屏的移动电话或平板电脑上用三根手指触摸屏幕,然后在一个显示对象上平行移动这三根手指)时调度。InteractiveObject
 Inherited当用户使用 InteractiveObject 实例创建接触点,然后点击启用触屏的设备时(例如,将几个手指放在显示对象上以打开菜单,然后点击一个手指在配有触摸屏的移动电话或平板电脑上选择一个菜单项)调度。InteractiveObject
 Inherited当用户在接触点处使用 InteractiveObject 实例执行缩放手势操作时(例如,将两个手指放在屏幕上,然后在配有触摸屏的移动电话或平板电脑上的显示对象上快速分开手指)调度。InteractiveObject
 Inherited在组件可见性从可见改为不可见以后调度。UIComponent
 Inherited此事件被调度到任何支持使用 IME 进行内联输入的客户端应用程序InteractiveObject
  已加载的 SWF 文件的属性和方法可访问时调度。UILoader
  在发生输入或输出错误以后调度。UILoader
 Inherited用户按下某个键时调度。InteractiveObject
 Inherited用户尝试使用键盘导航更改焦点时调度。InteractiveObject
 Inherited用户释放某个键时调度。InteractiveObject
 Inherited当用户在同一 InteractiveObject 上按下并释放用户指针设备的中间按钮时调度。InteractiveObject
 Inherited当用户在 InteractiveObject 实例上按下指针设备的中间按钮时调度。InteractiveObject
 Inherited当用户在 InteractiveObject 实例上释放指针设备按钮时调度。InteractiveObject
 Inherited当用户在 InteractiveObject 实例上按下指针设备按钮时调度。InteractiveObject
 Inherited用户尝试使用指针设备更改焦点时调度。InteractiveObject
 Inherited用户移动 InteractiveObject 上的指针设备时调度。InteractiveObject
 Inherited用户将指针设备从 InteractiveObject 实例上移开时调度。InteractiveObject
 Inherited用户将指针设备移动到 InteractiveObject 实例上时调度。InteractiveObject
 Inherited当用户在 InteractiveObject 实例上释放指针设备按钮时调度。InteractiveObject
 Inherited当鼠标滚轮滚动到 InteractiveObject 实例上时调度。InteractiveObject
 Inherited在移动组件以后调度。UIComponent
 Inherited当用户释放拖动手势时由拖动启动器 InteractiveObject 调度。InteractiveObject
 Inherited在将拖动对象放置到目标上且已通过对 DragManager.acceptDragDrop() 的调用接受该放置操作时,由目标 InteractiveObject 调度。InteractiveObject
 Inherited当拖动手势进入其边界时由 InteractiveObject 调度。InteractiveObject
 Inherited当拖动手势离开其边界时由 InteractiveObject 调度。InteractiveObject
 Inherited当拖动手势保持在其边界内时,由 InteractiveObject 持续调度。InteractiveObject
 Inherited在拖动操作开始时由在 DragManager.doDrag() 调用中指定为拖动启动器的 InteractiveObject 调度。InteractiveObject
 Inherited在拖动操作期间由在 DragManager.doDrag() 调用中指定为拖动启动器的 InteractiveObject 调度。InteractiveObject
  在网络操作开始以后调度。UILoader
 Inherited在用户为粘贴操作激活特定于平台的加速键组合或从文本上下文菜单中选择“粘贴”时调度。InteractiveObject
  当加载内容时调度。UILoader
 Inherited当用户将活动笔针放低经过屏幕的邻近检测阈值上时调度。InteractiveObject
 Inherited
    proximityEnd
当用户将活动笔针抬高放在屏幕的邻近检测阈值上时调度。InteractiveObject
 Inherited当用户将活动笔针移动到屏幕上但仍保留在邻近检测阈值中时调度。InteractiveObject
 Inherited
    proximityOut
当用户直接将活动笔针从此 InteractiveObject 上移开但仍保留在屏幕的邻近检测阈值中时调度。InteractiveObject
 Inherited当用户直接将活动笔针移动到此 InteractiveObject 上但仍保留在屏幕的邻近检测阈值中时调度。InteractiveObject
 Inherited当用户从此 InteractiveObject 及其任一子项中移开而仍保留在屏幕的邻近检测阈值中时调度。InteractiveObject
 Inherited当用户将活动笔针从显示列表中子项的对象树中滑过此 InteractiveObject 时(而仍保留在屏幕的邻近检测阈值中)时调度。InteractiveObject
 Inherited在用户首先在 InteractiveObject 实例上按下按钮,然后将指针设备移离 InteractiveObject 实例,释放指针设备上的按钮时调度。InteractiveObject
 Inherited将要从显示列表中删除显示对象时调度。DisplayObject
 Inherited在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。DisplayObject
 Inherited[广播事件] 将要更新和呈现显示列表时调度。DisplayObject
  在调整组件大小以后调度。UILoader
 Inherited当用户在同一 InteractiveObject 上按下并释放用户指针设备的右按钮时调度。InteractiveObject
 Inherited当用户在 InteractiveObject 实例上按下指针设备按钮时调度。InteractiveObject
 Inherited当用户在 InteractiveObject 实例上释放指针设备按钮时调度。InteractiveObject
 Inherited用户将指针设备从 InteractiveObject 实例上移开时调度。InteractiveObject
 Inherited用户将指针设备移动到 InteractiveObject 实例上时调度。InteractiveObject
  内容加载过程中发生安全性错误以后调度。UILoader
 Inherited在用户为全选操作激活特定于平台的加速键组合或从文本上下文菜单中选择“全选”时调度。InteractiveObject
 Inherited在组件可见性从不可见改为可见以后调度。UIComponent
 Inherited在放开软键盘之后立即调度。InteractiveObject
 Inherited在放开软键盘之前立即调度。InteractiveObject
 Inherited在隐藏软键盘之后立即调度。InteractiveObject
 Inherited对象的 tabChildren 标志值发生更改时调度。InteractiveObject
 Inherited对象的 tabEnabled 标志发生更改时调度。InteractiveObject
 Inherited对象的 tabIndex 属性值发生更改时调度。InteractiveObject
 Inherited当用户输入一个或多个文本字符时调度。InteractiveObject
 Inherited当用户第一次触摸启用触摸的设备时(例如,用手指触摸配有触摸屏的移动电话或平板)调度。InteractiveObject
 Inherited当用户移除与启用触摸的设备的接触时(例如,将手指从配有触摸屏的移动电话或平板电脑上抬起)调度。InteractiveObject
 Inherited当用户触碰设备时进行调度,而且会连续调度,直到接触点被删除。InteractiveObject
 Inherited当用户将接触点从启用触摸的设备上的 InteractiveObject 实例移开时(例如,在配有触摸屏的移动电话或平板电脑上,将手指从一个显示对象拖到另一个显示对象)调度。InteractiveObject
 Inherited当用户在启用触摸的设备的 InteractiveObject 实例上移动接触点时(例如,在配有触摸屏的移动电话或平板电脑上,将手指从显示对象外的一点拖动到显示对象上的一点)调度。InteractiveObject
 Inherited当用户移动接触点,使其远离启用触摸的设备上的 InteractiveObject 实例时(例如,在配有触摸屏的移动电话或平板电脑上将一个手指从显示对象上的一点移动到显示对象外的一点)调度。InteractiveObject
 Inherited当用户在启用触摸的设备的 InteractiveObject 实例上移动接触点时(例如,在配有触摸屏的移动电话或平板电脑上,将手指从显示对象外的一点拖动到显示对象上的一点)调度。InteractiveObject
 Inherited当用户在启用触摸设备上的已启动接触的同一 InteractiveObject 实例上抬起接触点时(例如,在配有触摸屏的移动电话或平板的显示对象上的某一点处按下并释放手指)调度。InteractiveObject
样式

样式为常见样式,或与特定主题关联。如果为常见样式,则可以用于任何主题。如果样式与特定主题关联,则只有应用程序使用该主题时才能使用该样式。

常见样式
 样式 说明 由以下参数定义
 Inherited类型: flash.text.TextFormat
语言版本: ActionScript 3.0  产品版本: Flash CS3  运行时版本: Flash9.0.28.0, AIR 1.0

用于在禁用了按钮的情况下呈现组件标签的 TextFormat 对象.
UIComponent
 Inherited类型: Number 格式: Length
语言版本: ActionScript 3.0  产品版本: Flash CS3  运行时版本: Flash9.0.28.0, AIR 1.0

用于分隔组件的外边框和焦点指示符的外边框的填充(以像素为单位).
UIComponent
 Inherited类型: Class
语言版本: ActionScript 3.0  产品版本: Flash CS3  运行时版本: Flash9.0.28.0, AIR 1.0

用于显示焦点指示符的外观.
UIComponent
 Inherited类型: flash.text.TextFormat
语言版本: ActionScript 3.0  产品版本: Flash CS3  运行时版本: Flash9.0.28.0, AIR 1.0

用于呈现组件标签的 TextFormat 对象.
UIComponent
公共常量
 常量由以下参数定义
 Inheritedversion : String = "3.0.3.1"
组件的版本号。
UIComponent
属性详细信息

autoLoad

属性
autoLoad:Boolean

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

获取或设置一个值,该值指示 UILoader 实例是否自动加载指定的内容。 true 值指示 UILoader 自动加载内容;false 值指示直到调用 load() 方法时才加载内容。

默认值为 true。



实现
    public function get autoLoad():Boolean
    public function set autoLoad(value:Boolean):void

相关 API 元素


示例  ( 如何使用本示例 )
下面的示例演示将 autoLoad 属性设置为 false 如何在调用 load() 方法前阻止内容加载:
import fl.containers.UILoader;
import fl.controls.Button;

var myUILoader:UILoader = new UILoader();
myUILoader.autoLoad = false;
myUILoader.scaleContent = false;
myUILoader.source = "http://www.helpexamples.com/flash/images/image1.jpg";
myUILoader.move(10, 40);
addChild(myUILoader);

var myButton:Button = new Button();
myButton.label = "Load image";
myButton.move(10, 10);
myButton.addEventListener(MouseEvent.CLICK, clickHandler);
addChild(myButton);

function clickHandler(event:MouseEvent):void {
    myUILoader.load();
}

bytesLoaded

属性 
bytesLoaded:uint  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

获取已加载的内容的字节数。如果此属性与 bytesTotal 的值相等,说明已加载所有字节。

默认值为 0。



实现
    public function get bytesLoaded():uint

相关 API 元素


示例  ( 如何使用本示例 )
下面的示例创建一个显示所加载图像的 UILoader 组件实例,以及显示图像当前下载状态的 ProgressBar 和 Label 组件实例:
import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar;
import fl.controls.ProgressBarMode;

var url:String = "http://www.helpexamples.com/flash/images/image3.jpg";

var myLabel:Label = new Label();
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.text = "";
myLabel.move(10, 10);
addChild(myLabel);

var myProgressBar:ProgressBar = new ProgressBar();
myProgressBar.mode = ProgressBarMode.MANUAL;
myProgressBar.move(10, 30);
addChild(myProgressBar);

var myUILoader:UILoader = new UILoader();
myUILoader.load(new URLRequest(url));
myUILoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
myUILoader.addEventListener(Event.COMPLETE, completeHandler);
myUILoader.move(10, 35);
addChild(myUILoader);

function progressHandler(event:ProgressEvent):void {
    var uiLdr:UILoader = event.currentTarget as UILoader;
    var kbLoaded:String = Number(uiLdr.bytesLoaded / 1024).toFixed(1);
    var kbTotal:String = Number(uiLdr.bytesTotal / 1024).toFixed(1);
    myLabel.text = kbLoaded + " of " + kbTotal + " KB" + " (" + Math.round(uiLdr.percentLoaded) + "%)";
    myProgressBar.setProgress(event.bytesLoaded, event.bytesTotal);
}

function completeHandler(event:Event):void {
    myLabel.visible = false;
    myProgressBar.visible = false;
    myUILoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
    myUILoader.removeEventListener(Event.COMPLETE, completeHandler);
}

bytesTotal

属性 
bytesTotal:uint  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

获取要加载的内容的字节数。

默认值为 0。



实现
    public function get bytesTotal():uint

相关 API 元素


示例  ( 如何使用本示例 )
下面的示例创建一个显示所加载图像的 UILoader 组件实例,以及显示图像当前下载状态的 ProgressBar 和 Label 组件实例:
import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar;
import fl.controls.ProgressBarMode;

var url:String = "http://www.helpexamples.com/flash/images/image3.jpg";

var myLabel:Label = new Label();
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.text = "";
myLabel.move(10, 10);
addChild(myLabel);

var myProgressBar:ProgressBar = new ProgressBar();
myProgressBar.mode = ProgressBarMode.MANUAL;
myProgressBar.move(10, 30);
addChild(myProgressBar);

var myUILoader:UILoader = new UILoader();
myUILoader.load(new URLRequest(url));
myUILoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
myUILoader.addEventListener(Event.COMPLETE, completeHandler);
myUILoader.move(10, 35);
addChild(myUILoader);

function progressHandler(event:ProgressEvent):void {
    var uiLdr:UILoader = event.currentTarget as UILoader;
    var kbLoaded:String = Number(uiLdr.bytesLoaded / 1024).toFixed(1);
    var kbTotal:String = Number(uiLdr.bytesTotal / 1024).toFixed(1);
    myLabel.text = kbLoaded + " of " + kbTotal + " KB" + " (" + Math.round(uiLdr.percentLoaded) + "%)";
    myProgressBar.setProgress(event.bytesLoaded, event.bytesTotal);
}

function completeHandler(event:Event):void {
    myLabel.visible = false;
    myProgressBar.visible = false;
    myUILoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
    myUILoader.removeEventListener(Event.COMPLETE, completeHandler);
}

content

属性 
content:DisplayObject  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

包含使用 load() 方法或设置 source 属性加载的 SWF 文件或图像文件(JPEG、PNG 或 GIF 格式文件)的根显示对象。 在加载开始前该值为 undefined。在 complete 事件的事件处理函数中设置内容的属性。

默认值为 null。



实现
    public function get content():DisplayObject

相关 API 元素


示例  ( 如何使用本示例 )
下面的示例创建一个滑块,用于修改 UILoader 对象内容的透明度:
import fl.controls.Slider;
import fl.containers.UILoader;
import fl.events.SliderEvent;

var s:Slider = new Slider();
s.minimum = 10;
s.maximum = 100;
s.liveDragging = true;
s.value = s.maximum;
s.move(10,10);
s.addEventListener(SliderEvent.THUMB_DRAG, updateUILoaderContentAlpha);
addChild(s);

var loader:UILoader = new UILoader();
loader.move(10,40);
loader.setSize(400, 300);
loader.source = "http://www.helpexamples.com/flash/images/image2.jpg";
addChild(loader);

function updateUILoaderContentAlpha(e:SliderEvent):void {
    loader.content.alpha = s.value/100;
}

maintainAspectRatio

属性 
maintainAspectRatio:Boolean

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

获取或设置一个值,该值指示是要保持原始图像中使用的高宽比,还是要将图像的大小调整为 UILoader 组件的当前宽度和高度。 true 值指示要保持原始高宽比;false 值指示应该将已加载内容的大小调整到 UILoader 的当前尺寸。

若要使用该属性,必须将 scaleContent 属性设置为 false,否则该属性会被忽略。

默认值为 true。



实现
    public function get maintainAspectRatio():Boolean
    public function set maintainAspectRatio(value:Boolean):void

相关 API 元素


示例  ( 如何使用本示例 )
下面的示例使用复选框切换 maintainAspectRatio 属性的值:
import fl.containers.UILoader;
import fl.controls.CheckBox;

var myUILoader:UILoader = new UILoader();
myUILoader.setSize(200, 200);
myUILoader.scaleContent = true;
myUILoader.maintainAspectRatio = true;
myUILoader.source = "http://www.helpexamples.com/flash/images/image3.jpg";
myUILoader.move(10, 10);
addChild(myUILoader);

var myCheckBox:CheckBox = new CheckBox();
myCheckBox.label = "maintainAspectRatio";
myCheckBox.selected = myUILoader.maintainAspectRatio;
myCheckBox.width = 150;
myCheckBox.move(220, 10);
myCheckBox.addEventListener(Event.CHANGE, changeHandler);
addChild(myCheckBox);

function changeHandler(event:Event):void {
    myUILoader.maintainAspectRatio = event.target.selected;
}

percentLoaded

属性 
percentLoaded:Number  [只读]

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

获取一个范围在 0 到 100 之间的数字,指示已加载内容的百分比。 如果从库(而不是外部加载的内容)加载资源,则 percentLoaded 属性设置为 0。

默认值为 0。



实现
    public function get percentLoaded():Number

相关 API 元素


示例  ( 如何使用本示例 )
下面的示例创建一个显示所加载图像的 UILoader 组件实例,以及显示图像当前下载状态的 ProgressBar 和 Label 组件实例:
import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar;
import fl.controls.ProgressBarMode;

var url:String = "http://www.helpexamples.com/flash/images/image3.jpg";

var myLabel:Label = new Label();
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.text = "";
myLabel.move(10, 10);
addChild(myLabel);

var myProgressBar:ProgressBar = new ProgressBar();
myProgressBar.mode = ProgressBarMode.MANUAL;
myProgressBar.move(10, 30);
addChild(myProgressBar);

var myUILoader:UILoader = new UILoader();
myUILoader.load(new URLRequest(url));
myUILoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
myUILoader.addEventListener(Event.COMPLETE, completeHandler);
myUILoader.move(10, 35);
addChild(myUILoader);

function progressHandler(event:ProgressEvent):void {
    var uiLdr:UILoader = event.currentTarget as UILoader;
    var kbLoaded:String = Number(uiLdr.bytesLoaded / 1024).toFixed(1);
    var kbTotal:String = Number(uiLdr.bytesTotal / 1024).toFixed(1);
    myLabel.text = kbLoaded + " of " + kbTotal + " KB" + " (" + Math.round(uiLdr.percentLoaded) + "%)";
    myProgressBar.setProgress(event.bytesLoaded, event.bytesTotal);
}

function completeHandler(event:Event):void {
    myLabel.visible = false;
    myProgressBar.visible = false;
    myUILoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
    myUILoader.removeEventListener(Event.COMPLETE, completeHandler);
}

scaleContent

属性 
scaleContent:Boolean

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

获取或设置一个值,该值指示是否要将图像自动缩放到 UILoader 实例的大小。 true 值指示将图像自动缩放到 UILoader 实例的大小;false 值指示将加载的内容自动缩放到其默认大小。

默认值为 true。



实现
    public function get scaleContent():Boolean
    public function set scaleContent(value:Boolean):void

相关 API 元素


示例  ( 如何使用本示例 )
下面的示例创建一个加载并匹配图像尺寸的 UILoader 对象:
import fl.containers.UILoader;

var loader:UILoader = new UILoader();
loader.scaleContent = false;
loader.source = "http://www.helpexamples.com/flash/images/image2.jpg";
addChild(loader);

source

属性 
source:Object

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

获取或设置以下内容:绝对或相对 URL(该 URL 标识要加载的 SWF 或图像文件的位置)、库中影片剪辑的类名称、对显示对象的引用或者与组件位于同一层上的影片剪辑的实例名称。

有效的图像文件格式包括 GIF、PNG 和 JPEG。 若要通过使用 URLRequest 对象加载资源,请使用 load() 方法。

默认值为 null。



实现
    public function get source():Object
    public function set source(value:Object):void

相关 API 元素


示例  ( 如何使用本示例 )
下面的示例创建一个加载并匹配图像尺寸的 UILoader 对象:
import fl.containers.UILoader;

var loader:UILoader = new UILoader();
loader.scaleContent = false;
loader.source = "http://www.helpexamples.com/flash/images/image2.jpg";
addChild(loader);
构造函数详细信息

UILoader

()构造函数
public function UILoader()

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

创建新的 UILoader 组件实例。

方法详细信息

close

()方法
public function close():void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

取消当前正在对 ProLoader 实例执行的 load() 方法操作。也可以从 source 参数调用 load() 方法。


引发
Error — URLStream 对象没有打开的流。

相关 API 元素


示例  ( 如何使用本示例 )

下面的示例创建一个 UILoader 组件实例,以及一个可用来取消 UILoader 实例的图像下载的 Button 组件实例:
import fl.containers.UILoader;
import fl.controls.Button;

var myUILoader:UILoader = new UILoader();
myUILoader.source = "http://www.helpexamples.com/flash/images/image1.jpg";
myUILoader.move(10, 30);
addChild(myUILoader);

var cancelButton:Button = new Button();
cancelButton.label = "Cancel download";
cancelButton.move(10, 10);
cancelButton.addEventListener(MouseEvent.CLICK, clickHandler);
addChild(cancelButton);

function clickHandler(event:MouseEvent):void {
    var uil:UILoader = myUILoader;
    try {
        uil.close();
        trace("Download cancelled:", uil.source);
    } catch (error:Error) {
        trace("Unable to cancel download.", error.message);
    }
}

getStyleDefinition

()方法 
public static function getStyleDefinition():Object

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

检索当前组件的默认样式映射。 样式映射包含适合组件的类型,具体取决于组件使用的样式。 例如,disabledTextFormat 样式包含 null 值或 TextFormat 对象。 可以使用这些样式并对当前组件调用 setStyle()。下面的代码覆盖指定组件上默认的 disabledTextFormat 样式:

componentInstance.setStyle("disabledTextFormat", new TextFormat());

返回
Object — 默认样式对象。

相关 API 元素


示例  ( 如何使用本示例 )

下例为多个组件类创建一个样式浏览器:
import fl.controls.*;
import fl.containers.*;
import fl.controls.listClasses.*;
import fl.controls.dataGridClasses.*;
import fl.controls.progressBarClasses.*;
import fl.core.UIComponent;
import fl.data.DataProvider;

var dp:DataProvider = new DataProvider();
dp.addItem( { label: "BaseScrollPane",    data:BaseScrollPane } );
dp.addItem( { label: "Button",             data:Button } );
dp.addItem( { label: "CellRenderer",    data:CellRenderer } );
dp.addItem( { label: "CheckBox",         data:CheckBox } );
dp.addItem( { label: "ColorPicker",     data:ColorPicker } );
dp.addItem( { label: "ComboBox",         data:ComboBox } );
dp.addItem( { label: "DataGrid",         data:DataGrid } );
dp.addItem( { label: "HeaderRenderer",    data:HeaderRenderer } );
dp.addItem( { label: "ImageCell",        data:ImageCell } );
dp.addItem( { label: "IndeterminateBar",data:IndeterminateBar } );
dp.addItem( { label: "Label",             data:Label } );
dp.addItem( { label: "List",             data:List } );
dp.addItem( { label: "NumericStepper",     data:NumericStepper } );
dp.addItem( { label: "ProgressBar",     data:ProgressBar } );
dp.addItem( { label: "RadioButton",     data:RadioButton } );
dp.addItem( { label: "ScrollPane",         data:ScrollPane } );
dp.addItem( { label: "Slider",             data:Slider } );
dp.addItem( { label: "TextArea",         data:TextArea } );
dp.addItem( { label: "TextInput",         data:TextInput } );
dp.addItem( { label: "TileList",         data:TileList } );
dp.addItem( { label: "UILoader",         data:UILoader } );
dp.addItem( { label: "UIComponent",     data:UIComponent } );

var cb:ComboBox = new ComboBox();
cb.move(10,10);
cb.setSize(300,25);
cb.prompt = "Select a component to view its styles";
cb.rowCount = 12;
cb.dataProvider = dp;
cb.addEventListener(Event.CHANGE, showStyleDefinition);
addChild(cb);

var dg:DataGrid = new DataGrid();
dg.setSize(425,300);
dg.move(10,50);
dg.columns = [ new DataGridColumn("StyleName"), new DataGridColumn("DefaultValue") ];
addChild(dg);

function showStyleDefinition(e:Event):void {
    var componentClass:Class = e.target.selectedItem.data as Class;
    var styles:Object = componentClass["getStyleDefinition"].call(this);
    trace(styles.toString());
    var styleData:DataProvider = new DataProvider();
    for(var i:* in styles) {
        trace(i + " : " + styles[i]);
        styleData.addItem( { StyleName:i, DefaultValue:styles[i] } );
    }
    styleData.sortOn("StyleName");
    dg.dataProvider = styleData;
}

load

()方法 
public function load(request:URLRequest = null, context:LoaderContext = null):void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

加载指定内容,或者,如果未指定内容,则加载 source 属性标识的位置的内容。 默认情况下,LoaderContext 对象使用当前域作为应用程序域。 若要指定不同的应用程序域、检查策略文件或更改安全域,请初始化新的 LoaderContext 对象并将其传递给该方法。

默认情况下 context 属性使用当前域。 若要指定不同的 ApplicationDomain、检查策略文件或更改 SecurityDomain,请传递新的 LoaderContext 对象。

参数

request:URLRequest (default = null) — 标识要从中加载内容的位置的 URLRequest 对象。 如果未指定该值,则 source 属性的当前值将用作内容位置。
 
context:LoaderContext (default = null) — 设置加载操作上下文的 LoaderContext 对象。

相关 API 元素


示例  ( 如何使用本示例 )

下面的示例创建一个新的 UILoader 实例,并使用 load() 方法和 source 属性加载图像:
import fl.containers.UILoader;

var myUILoader:UILoader = new UILoader();
myUILoader.autoLoad = false;
myUILoader.scaleContent = false;
myUILoader.source = "http://www.helpexamples.com/flash/images/image3.jpg";
myUILoader.load();
myUILoader.move(10, 10);
addChild(myUILoader);

下面的示例创建一个新的 UILoader 实例,并使用 load() 方法和 URLRequest 实例加载图像:
import fl.containers.UILoader;

var url:String = "http://www.helpexamples.com/flash/images/image3.jpg";
var req:URLRequest = new URLRequest(url);

var myUILoader:UILoader = new UILoader();
myUILoader.scaleContent = false;
myUILoader.move(10, 10);
myUILoader.load(req);
addChild(myUILoader);

loadBytes

()方法 
public function loadBytes(bytes:ByteArray, context:LoaderContext = null):void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

加载 ByteArray 对象中存储的二进制数据。

参数

bytes:ByteArray — 一个 ByteArray 对象,该对象包含一个采用 ProLoader 类支持的格式(SWF、GIF、JPEG 或 PNG)之一的文件。
 
context:LoaderContext (default = null) — 只应用 LoaderContext 对象的 applicationDomain 属性;不应用 LoaderContext 对象的 checkPolicyFilesecurityDomain 属性。


引发
ArgumentError — ByteArray 对象的 length 属性为 0。
 
IllegalOperationError context 参数的 checkPolicyFilesecurityDomain 属性为非空。
 
SecurityError — 提供的 context 属性的 applicationDomain 属性来自不允许的域。

相关 API 元素


示例  ( 如何使用本示例 )

下面的示例将 GIF 的原始字节加载到 UILoader 对象中:
import fl.containers.UILoader;

var imageBytes:Array = [ 71, 73, 70, 56, 57, 97, 50, 0, 30, 0, 230, 0, 0, 0, 0, 0, 173, 169, 206, 82, 73, 153, 74, 74, 74, 115, 109, 155, 248, 247, 251, 102, 102, 102, 26, 24, 35, 181, 181, 181, 70, 61, 145, 222, 222, 222, 153, 153, 153, 204, 204, 204, 58, 58, 58, 132, 132, 132, 231, 231, 231, 8, 7, 14, 90, 90, 90, 89, 81, 163, 153, 153, 153, 191, 188, 217, 165, 165, 165, 190, 190, 190, 237, 237, 233, 51, 51, 51, 214, 214, 214, 90, 82, 156, 156, 152, 190, 123, 123, 123, 140, 140, 140, 140, 135, 187, 103, 96, 165, 78, 70, 150, 173, 173, 173, 127, 121, 179, 82, 82, 82, 206, 204, 226, 195, 195, 193, 102, 102, 102, 247, 247, 247, 41, 41, 41, 66, 66, 66, 183, 179, 212, 146, 141, 190, 21, 21, 20, 227, 226, 238, 119, 111, 181, 198, 195, 221, 99, 91, 162, 255, 255, 255, 218, 216, 233, 114, 114, 114, 16, 15, 27, 114, 107, 171, 210, 208, 228, 8, 8, 8, 179, 175, 209, 240, 239, 246, 153, 153, 153, 234, 233, 243, 95, 88, 160, 90, 74, 156, 33, 33, 33, 16, 16, 16, 163, 159, 200, 142, 137, 188, 197, 189, 222, 134, 129, 183, 151, 147, 193, 202, 199, 223, 222, 221, 235, 122, 115, 176, 215, 213, 231, 74, 66, 147, 82, 75, 146, 197, 197, 197, 106, 99, 166, 231, 230, 240, 175, 171, 207, 239, 239, 239, 209, 207, 227, 25, 25, 22, 119, 112, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 249, 4, 0, 7, 0, 255, 0, 44, 0, 0, 0, 0, 50, 0, 30, 0, 0, 7, 255, 128, 49, 130, 131, 132, 132, 8, 24, 0, 16, 6, 15, 133, 141, 5, 54, 69, 77, 141, 147, 148, 147, 51, 63, 0, 153, 0, 40, 8, 148, 5, 1, 53, 48, 48, 31, 30, 50, 149, 167, 133, 5, 41, 154, 172, 0, 33, 141, 59, 76, 9, 2, 26, 181, 32, 32, 42, 168, 168, 170, 173, 172, 63, 23, 132, 59, 31, 32, 181, 197, 181, 73, 185, 186, 147, 5, 3, 189, 173, 29, 131, 194, 196, 198, 198, 184, 202, 141, 205, 206, 172, 35, 130, 77, 195, 212, 224, 73, 56, 215, 131, 217, 218, 154, 41, 49, 222, 211, 224, 212, 226, 228, 230, 231, 153, 6, 5, 223, 237, 237, 239, 186, 241, 242, 0, 11, 46, 236, 247, 194, 5, 64, 181, 79, 222, 129, 15, 180, 2, 6, 76, 226, 164, 82, 193, 115, 52, 148, 72, 80, 72, 145, 225, 164, 135, 218, 34, 242, 160, 200, 145, 225, 133, 12, 229, 248, 177, 210, 200, 177, 36, 136, 13, 140, 98, 112, 16, 169, 9, 130, 146, 141, 37, 75, 38, 121, 17, 195, 2, 38, 150, 81, 8, 76, 228, 40, 160, 39, 79, 38, 77, 26, 176, 4, 192, 130, 129, 148, 132, 10, 147, 0, 65, 162, 1, 169, 194, 32, 67, 127, 100, 40, 224, 244, 94, 18, 34, 130, 108, 248, 228, 200, 242, 7, 131, 24, 70, 170, 134, 91, 65, 8, 202, 86, 133, 17, 248, 121, 21, 148, 131, 135, 216, 98, 73, 255, 130, 52, 42, 114, 182, 157, 8, 5, 62, 206, 173, 29, 228, 33, 137, 85, 15, 148, 232, 190, 213, 0, 195, 84, 5, 109, 123, 7, 181, 104, 26, 110, 200, 169, 23, 32, 196, 38, 24, 40, 168, 195, 141, 86, 40, 190, 54, 34, 161, 33, 73, 207, 158, 73, 0, 163, 122, 33, 192, 115, 79, 16, 87, 11, 101, 152, 209, 0, 195, 128, 5, 39, 42, 237, 32, 194, 132, 7, 143, 35, 20, 174, 181, 88, 241, 193, 182, 8, 154, 228, 42, 229, 200, 17, 188, 184, 241, 224, 29, 150, 148, 0, 25, 35, 67, 133, 24, 39, 20, 44, 89, 18, 3, 1, 243, 37, 8, 136, 215, 68, 112, 34, 250, 146, 39, 5, 16, 88, 16, 36, 125, 73, 120, 230, 25, 16, 164, 44, 81, 194, 0, 2, 235, 5, 44, 116, 232, 244, 0, 67, 135, 8, 41, 58, 52, 200, 80, 194, 129, 131, 1, 49, 204, 48, 195, 2, 6, 224, 197, 65, 6, 35, 44, 192, 193, 12, 57, 160, 112, 95, 126, 13, 40, 16, 130, 1, 21, 140, 144, 129, 3, 51, 84, 128, 194, 18, 28, 148, 32, 31, 7, 6, 196, 160, 64, 4, 49, 44, 65, 162, 3, 11, 88, 128, 98, 10, 10, 164, 35, 72, 6, 0, 46, 48, 131, 32, 3, 88, 64, 98, 123, 42, 85, 136, 226, 12, 29, 112, 163, 146, 5, 28, 88, 16, 66, 7, 11, 0, 56, 98, 77, 33, 162, 56, 194, 88, 18, 10, 52, 240, 64, 4, 22, 40, 208, 1, 3, 36, 50, 48, 130, 116, 17, 28, 9, 100, 12, 14, 132, 224, 64, 7, 82, 142, 168, 94, 10, 37, 112, 16, 66, 10, 25, 48, 144, 194, 5, 90, 38, 89, 193, 2, 40, 140, 128, 65, 5, 12, 248, 224, 3, 7, 79, 10, 226, 128, 157, 37, 156, 192, 141, 5, 51, 114, 80, 193, 19, 24, 196, 121, 66, 157, 173, 49, 208, 161, 3, 40, 68, 208, 0, 7, 129, 0, 0, 59 ];

var totalBytes:uint = imageBytes.length;
var newBytes:ByteArray = new ByteArray()
var i:uint;
for(i=0; i<totalBytes; i++) {
    newBytes.writeByte(imageBytes[i]);
}

var loader:UILoader = new UILoader();
loader.loadBytes(newBytes);
addChild(loader);

setSize

()方法 
override public function setSize(w:Number, h:Number):void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

将组件调整为所要求的大小。 如果 scaleContent 属性设置为 true,则不调整 UILoader 的大小。

参数

w:Number — 组件的宽度,以像素为单位。
 
h:Number — 组件的高度,以像素为单位。

相关 API 元素


示例  ( 如何使用本示例 )

下面的示例创建一个 UILoader 组件实例,并使用 setSize() 方法在舞台上调整该实例的大小:
import fl.containers.UILoader;

var myUILoader:UILoader = new UILoader();
myUILoader.source = "http://www.helpexamples.com/flash/images/image2.jpg";
myUILoader.addEventListener(Event.COMPLETE, completeHandler);
addChild(myUILoader);

function completeHandler(event:Event):void {
    var uiLdr:UILoader = event.currentTarget as UILoader;
    var image:DisplayObject = uiLdr.content as DisplayObject;
    trace("UILoader:", uiLdr.width, uiLdr.height); // 100 100
    trace("UILoader.content:", image.width, image.height); // 400 267
    uiLdr.setSize(image.width, image.height);
    uiLdr.move((stage.stageWidth - image.width) / 2, (stage.stageHeight - image.height) / 2);
}

unload

()方法 
public function unload():void

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

删除使用 load() 方法或 source 属性加载的此 UILoader 对象的子项。

相关 API 元素


示例  ( 如何使用本示例 )

下面的示例将一个图像加载到 UILoader 组件中,并在调度 UILoader 组件的 click 事件时卸载加载的图像:
import fl.containers.UILoader;

var myUILoader:UILoader = new UILoader();
myUILoader.source = "http://www.helpexamples.com/flash/images/image1.jpg";
myUILoader.move(10, 10);
myUILoader.addEventListener(MouseEvent.CLICK, clickHandler);
addChild(myUILoader);

function clickHandler(event:MouseEvent):void {
    var uil:UILoader = event.currentTarget as UILoader;
    uil.unload();
    removeChild(uil);
}
事件详细信息

complete

事件
事件对象类型: flash.events.Event
属性 Event.type = flash.events.Event.COMPLETE

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在内容加载完成时调度。不论加载操作是由自动加载过程触发还是由对 load() 方法的显式调用触发,都会调度该事件。

Event.COMPLETE 常量定义 complete 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
currentTarget当前正在使用某个事件侦听器处理 Event 对象的对象。
target已完成加载的网络对象。

示例  ( 如何使用本示例 )

下面的示例创建一个 UILoader 实例,当指定图像加载完成后,将该图像放置在舞台中央:
import fl.containers.UILoader;

var myUILoader:UILoader = new UILoader();
myUILoader.scaleContent = false;
myUILoader.source = "http://www.helpexamples.com/flash/images/image2.jpg";
myUILoader.addEventListener(Event.COMPLETE, completeHandler);
addChild(myUILoader);

function completeHandler(event:Event):void {
    var uiLdr:UILoader = event.currentTarget as UILoader;
    var newX:uint = (stage.stageWidth - uiLdr.content.width) / 2;
    var newY:uint = (stage.stageHeight - uiLdr.content.height) / 2;
    uiLdr.move(newX, newY);
}

相关 API 元素

init

事件  
事件对象类型: flash.events.Event
属性 Event.type = flash.events.Event.INIT

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

已加载的 SWF 文件的属性和方法可访问时调度。要调度此事件,必须存在以下条件:

  • 与加载的对象关联的所有属性和方法以及与组件关联的属性和方法必须是可访问的。
  • 所有子对象的构造函数必须已完成。

Event.INIT 常量定义 init 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
currentTarget当前正在使用某个事件侦听器处理 Event 对象的对象。
target与所加载的 SWF 文件相关联的 LoaderInfo 对象。

ioError

事件  
事件对象类型: flash.events.IOErrorEvent
属性 IOErrorEvent.type = flash.events.IOErrorEvent.IO_ERROR

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在发生输入或输出错误以后调度。

定义 ioError 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
currentTarget当前正在使用某个事件侦听器处理 Event 对象的对象。
errorID与特定错误关联的引用编号(仅限 AIR)。
target发生输入/输出错误的网络对象。
text要显示为错误消息的文本。

示例  ( 如何使用本示例 )

下面的示例创建一个 UILoader 组件实例并尝试加载一个不存在的文件,这将导致调度 ioError 事件:
import fl.containers.UILoader;

var url:String = "http://www.helpexamples.com/flash/images/image404.jpg"

var myUILoader:UILoader = new UILoader();
myUILoader.load(new URLRequest(url));
myUILoader.move(10, 10);
myUILoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
addChild(myUILoader);

function ioErrorHandler(event:IOErrorEvent):void {
    trace("<<", event.text, ">>");
    myUILoader.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    removeChild(myUILoader);
}

open

事件  
事件对象类型: flash.events.Event
属性 Event.type = flash.events.Event.OPEN

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在网络操作开始以后调度。

Event.OPEN 常量用于定义 open 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
currentTarget当前正在使用某个事件侦听器处理 Event 对象的对象。
target已打开连接的网络对象。

progress

事件  
事件对象类型: flash.events.ProgressEvent
属性 ProgressEvent.type = flash.events.ProgressEvent.PROGRESS

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

当加载内容时调度。 不论加载操作是由自动加载过程触发还是由对 load() 方法的显式调用触发,都会调度该事件。

定义 progress 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
bytesLoaded在侦听器处理事件时加载的项数或字节数。
bytesTotal如果加载进程成功,最终将加载的项目或字节总数。
cancelablefalse;没有要取消的默认行为。
currentTarget当前正在使用某个事件侦听器处理 Event 对象的对象。
target报告进度的对象。

示例  ( 如何使用本示例 )

下面的示例创建一个显示所加载图像的 UILoader 组件实例,以及显示图像当前下载状态的 ProgressBar 和 Label 组件实例:
import fl.containers.UILoader;
import fl.controls.Label;
import fl.controls.ProgressBar;
import fl.controls.ProgressBarMode;

var url:String = "http://www.helpexamples.com/flash/images/image3.jpg";

var myLabel:Label = new Label();
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.text = "";
myLabel.move(10, 10);
addChild(myLabel);

var myProgressBar:ProgressBar = new ProgressBar();
myProgressBar.mode = ProgressBarMode.MANUAL;
myProgressBar.move(10, 30);
addChild(myProgressBar);

var myUILoader:UILoader = new UILoader();
myUILoader.load(new URLRequest(url));
myUILoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
myUILoader.addEventListener(Event.COMPLETE, completeHandler);
myUILoader.move(10, 35);
addChild(myUILoader);

function progressHandler(event:ProgressEvent):void {
    var uiLdr:UILoader = event.currentTarget as UILoader;
    var kbLoaded:String = Number(uiLdr.bytesLoaded / 1024).toFixed(1);
    var kbTotal:String = Number(uiLdr.bytesTotal / 1024).toFixed(1);
    myLabel.text = kbLoaded + " of " + kbTotal + " KB" + " (" + Math.round(uiLdr.percentLoaded) + "%)";
    myProgressBar.setProgress(event.bytesLoaded, event.bytesTotal);
}

function completeHandler(event:Event):void {
    myLabel.visible = false;
    myProgressBar.visible = false;
    myUILoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
    myUILoader.removeEventListener(Event.COMPLETE, completeHandler);
}

相关 API 元素

resize

事件  
事件对象类型: fl.events.ComponentEvent
属性 ComponentEvent.type = fl.events.ComponentEvent.RESIZE

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

在调整组件大小以后调度。

定义 resize 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
currentTarget当前正在使用某个事件侦听器处理 Event 对象的对象。
target调度了事件的对象。target 不一定是侦听该事件的对象。使用 currentTarget 属性可以访问侦听该事件的对象。

示例  ( 如何使用本示例 )

下面的示例创建一个 UILoader 组件实例,侦听 resize 事件,并在完成图像加载后将该图像放置在舞台中央:
import fl.containers.UILoader;
import fl.events.ComponentEvent;

var myUILoader:UILoader = new UILoader();
myUILoader.scaleContent = false;
myUILoader.source = "http://www.helpexamples.com/flash/images/image3.jpg";
myUILoader.addEventListener(ComponentEvent.RESIZE, resizeHandler);
addChild(myUILoader);

function resizeHandler(event:ComponentEvent):void {
    var uiLdr:UILoader = event.currentTarget as UILoader;
    trace(uiLdr.width, uiLdr.height); // 400 267
    uiLdr.move((stage.stageWidth - uiLdr.width) / 2, (stage.stageHeight - uiLdr.height) / 2);
}

securityError

事件  
事件对象类型: flash.events.SecurityErrorEvent
属性 SecurityErrorEvent.type = flash.events.SecurityErrorEvent.SECURITY_ERROR

语言版本: ActionScript 3.0
产品版本: Flash CS3
运行时版本: Flash Player 9.0.28.0, AIR 1.0

内容加载过程中发生安全性错误以后调度。

SecurityErrorEvent.SECURITY_ERROR 常量定义 securityError 事件对象的 type 属性值。

此事件具有以下属性:

属性
bubblesfalse
cancelablefalse;没有要取消的默认行为。
currentTarget当前正在使用某个事件侦听器处理 Event 对象的对象。
target报告安全错误的网络对象。
text要显示为错误消息的文本。
UILoaderExample.as

此示例演示与 UILoader 类的简单交互。
  1. 将 UILoader 的一个实例放在舞台上并将该实例命名为“uiLoader”。
  2. 将 Label 的一个实例放在 UILoader 实例的上面,并将其命名为“uiLoaderLabel”。
  3. 将此代码另存为 UILoaderExample.as 并保存到 FLA 文件所在的同一目录中。
  4. 将 FLA 中的 DocumentClass 设置为 UILoaderExample。
package
{
    import flash.display.Sprite;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.events.ProgressEvent;

    public class UILoaderExample extends Sprite
    {
        private var sampleImagePath:String = "test.jpg";
        
        public function UILoaderExample() {
            var request:URLRequest = new URLRequest(sampleImagePath);
            uiLoader.scaleContent = false;
            uiLoader.addEventListener(Event.COMPLETE,loadComplete);
            uiLoader.addEventListener(ProgressEvent.PROGRESS,loadProgress);            
            uiLoader.load(request);
        }
        private function loadProgress(e:ProgressEvent):void {
            uiLoaderLabel.text = String(e.target.percentLoaded);
        }
        private function loadComplete(e:Event):void {
            uiLoaderLabel.text = "Load Complete";    
        }
    }
}




[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。