fl.controls
public class TileList
继承TileList Inheritance SelectableList Inheritance BaseScrollPane Inheritance UIComponent Inheritance Sprite Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object
实现 IFocusManagerComponent

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

TileList 类提供呈行和列分布的网格,通常用来以“平铺”格式设置并显示图像。 用于此组件的默认单元格渲染器为 ImageCell 类。 ImageCell 单元格渲染器将显示缩略图图像和一个单行标签。 若要呈现 TileList 组件中基于列表的单元格,请使用 CellRenderer 类。

若要修改分隔图像单元格边框的填充,可以通过全局方式设置 imagePadding 样式,或者在 ImageCell 类上设置该样式。 与其它单元格样式一样,imagePadding 样式无法在 TileList 组件实例上进行设置。

查看示例

另请参见

fl.controls.listClasses.CellRenderer
fl.controls.listClasses.ImageCell



公共 属性
 属性定义方
 InheritedaccessibilityProperties : AccessibilityProperties
此显示对象的当前辅助功能选项。
DisplayObject
 InheritedallowMultipleSelection : Boolean
获取一个布尔值,指示能否一次选择多个列表项目。
SelectableList
 Inheritedalpha : Number
指示指定对象的 Alpha 透明度值。
DisplayObject
 InheritedblendMode : String
BlendMode 类中的一个值,用于指定要使用的混合模式。
DisplayObject
 InheritedbuttonMode : Boolean
指定此 sprite 的按钮模式。
Sprite
 InheritedcacheAsBitmap : Boolean
如果设置为 true,则 Flash Player 将缓存显示对象的内部位图表示形式。
DisplayObject
  columnCount : uint
获取或设置在列表中至少部分可见的列的列数。
TileList
  columnWidth : Number
获取或设置应用于列表中列的宽度,以像素为单位。
TileList
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 InheritedcontextMenu : ContextMenu
指定与此对象相关联的上下文菜单。
InteractiveObject
  dataProvider : DataProvider
获取或设置要查看的项目列表的数据模型。
TileList
  direction : String
获取或设置一个值,该值指示 TileList 组件是水平滚动还是垂直滚动。
TileList
 InheriteddoubleClickEnabled : Boolean
指定此对象是否接收 doubleClick 事件。
InteractiveObject
 InheriteddropTarget : DisplayObject
[read-only] 指定拖动 sprite 时经过的显示对象,或放置 sprite 的显示对象。
Sprite
 Inheritedenabled : Boolean
获取或设置一个值,该值指示组件是否可以接受用户交互。
UIComponent
 Inheritedfilters : Array
包含当前与显示对象关联的每个滤镜对象的索引数组。
DisplayObject
 InheritedfocusEnabled : Boolean
获取或设置一个布尔值,该值指示组件是否可以在用户单击它后获得焦点。
UIComponent
 InheritedfocusManager : IFocusManager
获取或设置为此组件及其同级组件控制焦点的 FocusManager。
UIComponent
 InheritedfocusRect : Object
指定此对象是否显示焦点矩形。
InteractiveObject
 Inheritedgraphics : Graphics
[read-only] 指定属于此 sprite 的 Graphics 对象,在此 sprite 中可执行矢量绘画命令。
Sprite
 Inheritedheight : Number
获取或设置组件的高度,以像素为单位。
UIComponent
 InheritedhitArea : Sprite
指定一个 sprite 用作另一个 sprite 的点击区域。
Sprite
 InheritedhorizontalLineScrollSize : Number
获取或设置一个值,该值描述当单击滚动箭头时要在水平方向上滚动的内容量。
BaseScrollPane
 InheritedhorizontalPageScrollSize : Number
获取或设置按滚动条轨道时水平滚动条上滚动滑块要移动的像素数。
BaseScrollPane
 InheritedhorizontalScrollBar : ScrollBar
[read-only] 获取对水平滚动条的引用。
BaseScrollPane
 InheritedhorizontalScrollPolicy : String
获取或设置一个值,该值指示水平滚动条的状态。
BaseScrollPane
 InheritedhorizontalScrollPosition : Number
获取或设置一个值,该值描述滚动窗格中水平滚动条的水平位置(以像素为单位)。
BaseScrollPane
  iconField : String
获取或设置用于提供项的图标的项字段。
TileList
  iconFunction : Function
获取或设置用于获得项的图标的函数。
TileList
  innerHeight : Number
[read-only] 获取内容区域的高度,以像素为单位。
TileList
  innerWidth : Number
[read-only] 获取内容区域的宽度,以像素为单位。
TileList
  labelField : String
在包含各拼贴的标签的各项中获取或设置一个字段。
TileList
  labelFunction : Function
获取一个函数,该函数显示项的多个字段,用于提供拼贴的标签文本。
TileList
 Inheritedlength : uint
[read-only] 获取数据提供者中的项目数。
SelectableList
 InheritedloaderInfo : LoaderInfo
[read-only] 返回一个 LoaderInfo 对象,其中包含加载此显示对象所属的文件的相关信息。
DisplayObject
 Inheritedmask : DisplayObject
调用显示对象被指定的 mask 对象遮罩。
DisplayObject
 InheritedmaxHorizontalScrollPosition : Number
获取或设置当 horizontalScrollPolicy 属性设置为 ScrollPolicy.ON 时,列表可以向右滚动的像素数。
SelectableList
 InheritedmaxVerticalScrollPosition : Number
[read-only] 获取当前内容的最大垂直滚动位置(以像素为单位)。
BaseScrollPane
 InheritedmouseChildren : Boolean
确定对象的子项是否支持鼠标。
DisplayObjectContainer
 InheritedmouseEnabled : Boolean
指定此对象是否接收鼠标消息。
InteractiveObject
 InheritedmouseFocusEnabled : Boolean
获取或设置一个值,该值指示组件是否可以在用户单击它后获得焦点。
UIComponent
 InheritedmouseX : Number
[read-only] 指示鼠标位置的 x 坐标,以像素为单位。
DisplayObject
 InheritedmouseY : Number
[read-only] 指示鼠标位置的 y 坐标,以像素为单位。
DisplayObject
 Inheritedname : String
指示 DisplayObject 的实例名称。
DisplayObject
 InheritednumChildren : int
[read-only] 返回此对象的子项数目。
DisplayObjectContainer
 InheritedopaqueBackground : Object
指定显示对象是否由于具有某种背景颜色而不透明。
DisplayObject
 Inheritedparent : DisplayObjectContainer
[read-only] 指示包含此显示对象的 DisplayObjectContainer 对象。
DisplayObject
 Inheritedprototype : Object
[static] 对类或函数对象的原型对象的引用。
Object
 Inheritedroot : DisplayObject
[read-only] 对于加载的 SWF 文件中的显示对象,root 属性是此 SWF 文件所表示的显示列表树结构部分中的顶级显示对象。
DisplayObject
 Inheritedrotation : Number
指示 DisplayObject 实例距其原始方向的旋转程度,以度为单位。
DisplayObject
  rowCount : uint
获取或设置在列表中至少部分可见的行的行数。
TileList
  rowHeight : Number
获取或设置应用于列表中每一行的高度,以像素为单位。
TileList
 Inheritedscale9Grid : Rectangle
当前有效的缩放网格。
DisplayObject
 InheritedscaleX : Number
将组件的当前宽度与缩放系数相乘。
UIComponent
 InheritedscaleY : Number
将组件的当前高度与缩放系数相乘。
UIComponent
  scrollPolicy : String
获取或设置 TileList 组件的滚动策略。
TileList
 InheritedscrollRect : Rectangle
显示对象的滚动矩形范围。
DisplayObject
 Inheritedselectable : Boolean
获取或设置一个布尔值,指示列表中的项目是否可选。
SelectableList
 InheritedselectedIndex : int
获取或设置单选列表中的选定项目的索引。
SelectableList
 InheritedselectedIndices : Array
获取或设置一个数组,其中包含从多选列表中选定的项目。
SelectableList
 InheritedselectedItem : Object
获取或设置从单选列表中选择的项目。
SelectableList
 InheritedselectedItems : Array
获取或设置一个数组,其中包含多选列表中的选定项目的对象。
SelectableList
 InheritedsoundTransform : SoundTransform
控制此 sprite 中的声音。
Sprite
  sourceField : String
获取或设置用于提供拼贴的源路径的项字段。
TileList
  sourceFunction : Function
获取或设置用于获得拼贴的源路径的函数。
TileList
 Inheritedstage : Stage
[read-only] 显示对象的舞台。
DisplayObject
 InheritedtabChildren : Boolean
确定对象的子项是否支持 Tab 键。
DisplayObjectContainer
 InheritedtabEnabled : Boolean
指定此对象是否遵循 Tab 键顺序。
InteractiveObject
 InheritedtabIndex : int
指定 SWF 文件中的对象按 Tab 键顺序排列。
InteractiveObject
 InheritedtextSnapshot : TextSnapshot
[read-only] 返回此 DisplayObjectContainer 实例的 TextSnapshot 对象。
DisplayObjectContainer
 Inheritedtransform : Transform
一个对象,具有与显示对象的矩阵、颜色转换和像素范围有关的属性。
DisplayObject
 InheriteduseBitmapScrolling : Boolean
设置为 true 时,滚动内容的 cacheAsBitmap 属性设置为 true;设置为 false 时,该值会关闭。
BaseScrollPane
 InheriteduseHandCursor : Boolean
布尔值,指示当鼠标滑过其 buttonMode 属性设置为 true 的 sprite 时是否显示手指形(手形光标)。
Sprite
 Inheritedversion : String = "3.0.0.13"
组件的版本号。
UIComponent
 InheritedverticalLineScrollSize : Number
获取或设置一个值,该值描述当单击滚动箭头时要在垂直方向上滚动多少像素。
BaseScrollPane
 InheritedverticalPageScrollSize : Number
获取或设置按滚动条轨道时垂直滚动条上滚动滑块要移动的像素数。
BaseScrollPane
 InheritedverticalScrollBar : ScrollBar
[read-only] 获取对垂直滚动条的引用。
BaseScrollPane
 InheritedverticalScrollPolicy : String
获取或设置一个值,该值指示垂直滚动条的状态。
BaseScrollPane
 InheritedverticalScrollPosition : Number
获取或设置一个值,该值描述滚动窗格中垂直滚动条的垂直位置(以像素为单位)。
BaseScrollPane
 Inheritedvisible : Boolean
获取或设置一个值,该值指示当前组件实例是否可见。
UIComponent
 Inheritedwidth : Number
获取或设置组件的宽度(以像素为单位)。
UIComponent
 Inheritedx : Number
获取或设置 x 坐标,该坐标表示组件在其父容器内沿 x 轴的位置。
UIComponent
 Inheritedy : Number
获取或设置 y 坐标,该坐标表示组件在其父容器内沿 y 轴的位置。
UIComponent
公共 方法
 方法定义方
  
创建新的 List 组件实例。
TileList
 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
向项目列表的末尾追加项目。
SelectableList
 Inherited
addItemAt(item:Object, index:uint):void
在指定索引位置处将项目插入列表。
SelectableList
 Inherited
指示安全限制是否会导致出现以下情况:在列表中忽略了使用指定 point 点调用 DisplayObjectContainer.getObjectsUnderPoint() 方法时返回的所有显示对象。
DisplayObjectContainer
 Inherited
clearRendererStyle(name:String, column:int = -1):void
清除列表中渲染器上所设置的样式。
SelectableList
 Inherited
清除列表中当前所选的项目,并将 selectedIndex 属性设置为 -1。
SelectableList
 Inherited
删除此组件实例中的样式属性。
UIComponent
 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
检索指定索引处的项目。
SelectableList
 Inherited
返回对象的数组,这些对象位于指定点下,并且是该 DisplayObjectContainer 实例的子项(或孙子项,依此类推)。
DisplayObjectContainer
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
返回一个矩形,该矩形根据 targetCoordinateSpace 参数定义的坐标系定义显示对象的边界,但不包括形状上的任何笔触。
DisplayObject
 Inherited
getRendererStyle(name:String, column:int = -1):Object
检索列表中渲染器上所设置的样式。
SelectableList
 Inherited
检索组件的样式查找链中设置的样式属性。
UIComponent
  
[static] 检索当前组件的默认样式映射。
TileList
 Inherited
将 point 对象从舞台(全局)坐标转换为显示对象的(本地)坐标。
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
使特定项目渲染器失效。
SelectableList
 Inherited
使位于指定索引处的项目的渲染器失效。
SelectableList
 Inherited
使整个列表失效,强制重绘列表项目。
SelectableList
 Inherited
检查列表中的指定项目是否处于选中状态。
SelectableList
 Inherited
指示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
为给定的项目对象(如果有)检索 ICellRenderer。
SelectableList
  
基于 labelField 和 labelFunction 属性检索渲染器将为给定数据对象显示的字符串。
TileList
 Inherited
将 point 对象从显示对象的(本地)坐标转换为舞台(全局)坐标。
DisplayObject
 Inherited
[static] 将多个类的样式合并到一个对象中。
UIComponent
 Inherited
将组件移动到其父项内的指定位置。
UIComponent
 Inherited
指示指定的属性是否存在、是否可枚举。
Object
 Inherited
删除列表中的所有项目。
SelectableList
 Inherited
从 DisplayObjectContainer 实例的子列表中删除指定的 child DisplayObject 实例。
DisplayObjectContainer
 Inherited
从 DisplayObjectContainer 的子列表中指定的 index 位置删除子 DisplayObject。
DisplayObjectContainer
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
 Inherited
从列表中删除指定项目。
SelectableList
 Inherited
删除指定索引位置处的项目。
SelectableList
 Inherited
用其它项目替换指定索引位置处的项目。
SelectableList
  
scrollToIndex(newCaretIndex:int):void
将列表滚动至位于指定索引处的项目。
TileList
 Inherited
将列表滚动至由 selectedIndex 属性的当前值指示的位置处的项目。
SelectableList
 Inherited
更改现有子项在显示对象容器中的位置。
DisplayObjectContainer
 Inherited
设置此组件的焦点。
UIComponent
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
setRendererStyle(name:String, style:Object, column:uint = 0):void
设置列表中渲染器上的样式。
SelectableList
 Inherited
setSize(width:Number, height:Number):void
将组件设置为指定宽度和高度。
UIComponent
 Inherited
setStyle(style:String, value:Object):void
对此组件实例设置样式属性。
UIComponent
 Inherited
sortItems(... sortArgs):*
对当前数据提供者的元素进行排序。
SelectableList
 Inherited
sortItemsOn(field:String, options:Object = null):*
以当前数据提供者的一个或多个字段为依据对其元素进行排序。
SelectableList
 Inherited
startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
允许用户拖动指定的 Sprite。
Sprite
 Inherited
结束 startDrag() 方法。
Sprite
 Inherited
交换两个指定子对象的 Z 轴顺序(从前到后顺序)。
DisplayObjectContainer
 Inherited
swapChildrenAt(index1:int, index2:int):void
在子级列表中两个指定的索引位置,交换子对象的 Z 轴顺序(前后顺序)。
DisplayObjectContainer
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
验证并更新此对象的属性和布局,如果需要的话重绘对象。
UIComponent
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何始祖为指定事件类型注册了事件侦听器。
EventDispatcher
事件
 事件摘要定义方
 Inherited Flash Player 获得操作系统焦点并变为活动状态时调度。EventDispatcher
 Inherited 将显示对象添加到显示列表中时调度。DisplayObject
 Inherited 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。DisplayObject
 Inherited 当在列表中选择了另一项目后调度。SelectableList
 Inherited 用户在同一 InteractiveObject 上按下并释放用户指针设备的主按钮时调度。InteractiveObject
 Inherited Flash Player 失去操作系统焦点并变为非活动状态时调度。EventDispatcher
 Inherited 如果 InteractiveObject 的 doubleClickEnabled 标志设置为 true,当用户在该对象上快速连续按下两次并释放指针设备的主按钮时调度。InteractiveObject
 Inherited 播放头进入新帧时调度。DisplayObject
 Inherited 显示对象获得焦点后调度。InteractiveObject
 Inherited 显示对象失去焦点后调度。InteractiveObject
 Inherited 在组件可见性从可见改为不可见以后调度。UIComponent
 Inherited 当用户单击组件中的项目时调度。SelectableList
 Inherited 当用户快速连续单击两次组件中的项目时调度。SelectableList
 Inherited 当用户将指针滑离组件中的项目时调度。SelectableList
 Inherited 当用户将指针滑过组件中的项目时调度。SelectableList
 Inherited 用户按下某个键时调度。InteractiveObject
 Inherited 用户尝试使用键盘导航更改焦点时调度。InteractiveObject
 Inherited 用户释放某个键时调度。InteractiveObject
 Inherited 在 Flash Player 窗口中,用户在 InteractiveObject 实例上按下指针设备按钮时调度。InteractiveObject
 Inherited 用户尝试使用指针设备更改焦点时调度。InteractiveObject
 Inherited 用户移动 InteractiveObject 上的指针设备时调度。InteractiveObject
 Inherited 用户将指针设备从 InteractiveObject 实例上移开时调度。InteractiveObject
 Inherited 在 Flash Player 窗口中,用户将指针设备移动到 InteractiveObject 实例上时调度。InteractiveObject
 Inherited 在 Flash Player 窗口中,用户在 InteractiveObject 实例上释放指针设备按钮时调度。InteractiveObject
 Inherited 在 Flash Player 窗口中,鼠标滚轮滚动到 InteractiveObject 实例上时调度。InteractiveObject
 Inherited 在移动组件以后调度。UIComponent
 Inherited 将要从显示列表中删除显示对象时调度。DisplayObject
 Inherited 在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。DisplayObject
 Inherited 将要更新和呈现显示列表时调度。DisplayObject
 Inherited 在调整组件大小以后调度。UIComponent
 Inherited 当用户将指针滑离组件时调度。SelectableList
 Inherited 当用户将指针滑过组件时调度。SelectableList
 Inherited 当用户水平或垂直滚动时调度。SelectableList
 Inherited 在组件可见性从不可见改为可见以后调度。UIComponent
 Inherited 对象的 tabChildren 标志值发生更改时调度。InteractiveObject
 Inherited 对象的 tabEnabled 标志发生更改时调度。InteractiveObject
 Inherited 对象的 tabIndex 属性值发生更改时调度。InteractiveObject
样式
 样式说明定义方
  
cellRenderer
类型: Class
用于呈现 TileList 组件中的每个项目的单元格渲染器。 默认值为 fl.contols.listClasses.ImageCell.
TileList
 Inherited 类型: Number   格式: Length
用于分隔列表边框和列表内容的填充(以像素为单位)。 默认值为 null.
SelectableList
 Inherited 类型: Number
当 enabled 属性为 false 时将列表设置为的 Alpha 值。 默认值为 null.
SelectableList
 Inherited 类型: flash.text.TextFormat
用于在禁用了按钮的情况下呈现组件标签的 TextFormat 对象。 默认值为 TextFormat("_sans", 11, 0x999999, false, false, false, '', '', TextFormatAlign.LEFT, 0, 0, 0, 0).
UIComponent
 Inherited 类型: Class
类的名称,该类用作当禁用了滚动条时滚动条的向下箭头按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowDown_disabledSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作当单击滚动条的向下箭头按钮时该按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowDown_downSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作当鼠标指针在滚动条的向下箭头按钮上方时该按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowDown_overSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作滚动条的向下箭头按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowDown_upSkin.
BaseScrollPane
 Inherited 类型: Number   格式: Length
用于分隔组件的外边框和焦点指示符的外边框的填充(以像素为单位)。 默认值为 2.
UIComponent
 Inherited 类型: Class
用于显示焦点指示符的外观。 默认值为 focusRectSkin.
UIComponent
 Inherited 类型: Number   格式: Time
在第一次调度 buttonDown 事件之后、发送第二个 buttonDown 事件之前等待的毫秒数。. 默认值为 500.
BaseScrollPane
 Inherited 类型: Number   格式: Time
在由 repeatDelay 样式指定的延迟之后调度的 buttonDown 事件之间的间隔(以毫秒为单位)。. 默认值为 35.
BaseScrollPane
  
skin
类型: Class
用作 TileList 组件背景的外观。 默认值为 TileList_skin.
TileList
 Inherited 类型: flash.text.TextFormat
用于呈现组件标签的 TextFormat 对象。 默认值为 TextFormat("_sans", 11, 0x000000, false, false, false, '', '', TextFormatAlign.LEFT, 0, 0, 0, 0).
UIComponent
 Inherited 类型: Class
用于指示缩略图的禁用状态的外观。. 默认值为 ScrollThumb_upSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作当单击滚动条的缩略图时该缩略图的外观。. 默认值为 ScrollThumb_downSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作滚动条的缩略图的图标。. 默认值为 ScrollBar_thumbIcon.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作当鼠标指针在滚动条的缩略图上方时该缩略图的外观。. 默认值为 ScrollThumb_overSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作滚动条的缩略图的外观。. 默认值为 ScrollThumb_upSkin.
BaseScrollPane
 Inherited 类型: Class
用于指示被禁用轨道的外观。. 默认值为 ScrollTrack_Skin.
BaseScrollPane
 Inherited 类型: Class
用于指示被禁用外观的按下状态的外观。. 默认值为 ScrollTrack_Skin.
BaseScrollPane
 Inherited 类型: Class
用于指示滚动轨道的鼠标悬停状态的外观。. 默认值为 ScrollTrack_Skin.
BaseScrollPane
 Inherited 类型: Class
用于指示滚动轨道的鼠标松开状态的外观。. 默认值为 ScrollTrack_Skin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作当禁用了滚动条时滚动条的向上箭头按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowUp_disabledSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作当单击滚动条的向上箭头按钮时该按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowUp_downSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作当鼠标指针在滚动条的向上箭头按钮上方时该按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowUp_overSkin.
BaseScrollPane
 Inherited 类型: Class
类的名称,该类用作滚动条的向上箭头按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowUp_upSkin.
BaseScrollPane
属性详细信息
columnCount属性
columnCount:uint  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置在列表中至少部分可见的列的列数。 设置 columnCount 属性将改变列表的宽度,但 TileList 组件不会保持该值。 设置 columnCount之前请先设置 dataProviderrowHeight 值,这一点非常重要。 唯一例外的是通过属性检查器设置 rowCount 的情况;在这种情况下,在第一次绘制组件之前将保持该属性。

默认值为 0.


实现
    public function get columnCount():uint
    public function set columnCount(value:uint):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并通过设置其 columnCountrowCount 属性来调整其大小:

import fl.controls.TileList;
import fl.controls.ScrollBarDirection;

var myTileList:TileList = new TileList();
myTileList.addItem({label:"Image 1", source:"http://www.helpexamples.com/flash/images/image1.jpg"});
myTileList.addItem({label:"Image 2", source:"http://www.helpexamples.com/flash/images/image2.jpg"});
myTileList.addItem({label:"Image 3", source:"http://www.helpexamples.com/flash/images/image3.jpg"});
myTileList.direction = ScrollBarDirection.VERTICAL;
myTileList.columnWidth = 200;
myTileList.rowHeight = 134;
myTileList.columnCount = 1;
myTileList.rowCount = 2;
myTileList.move(10, 10);
addChild(myTileList);
columnWidth属性 
columnWidth:Number  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置应用于列表中列的宽度,以像素为单位。

默认值为 50.


实现
    public function get columnWidth():Number
    public function set columnWidth(value:Number):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并根据滑块值设置其 columnWidthrowHeight 属性:

import fl.controls.Slider;
import fl.controls.TileList;
import fl.data.DataProvider;
import fl.events.SliderEvent;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var imagesXML:XML = <images>
        <img src="image1.jpg" alt="Image 1" />
        <img src="image2.jpg" alt="Image 2" />
        <img src="image3.jpg" alt="Image 3" />
    </images>;

var dp:DataProvider = new DataProvider(imagesXML);

var columnWidthSlider:Slider = new Slider();
columnWidthSlider.minimum = 50;
columnWidthSlider.maximum = 200;
columnWidthSlider.liveDragging = true;
columnWidthSlider.snapInterval = 10;
columnWidthSlider.tickInterval = 10;
columnWidthSlider.width = columnWidthSlider.maximum - columnWidthSlider.minimum;
columnWidthSlider.move(10, 10);
columnWidthSlider.addEventListener(SliderEvent.CHANGE, changeHandler);
addChild(columnWidthSlider);

var myTileList:TileList = new TileList();
myTileList.dataProvider = dp;
myTileList.labelField = "alt";
myTileList.sourceFunction = mySourceFunction;
myTileList.width = 530;
myTileList.rowCount = 1;
myTileList.move(10, 30);
addChild(myTileList);

function mySourceFunction(item:Object):String {
    return baseURL + item.src;
}

function changeHandler(event:SliderEvent):void {
    myTileList.columnWidth = event.value;
    myTileList.rowHeight = event.value;
    myTileList.rowCount = 1;
}
dataProvider属性 
dataProvider:DataProvider  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置要查看的项目列表的数据模型。 数据提供者可由多个基于列表的组件共享。 对数据提供者所做的更改会立即应用于将其用作数据源的所有组件。


实现
    public function get dataProvider():DataProvider
    public function set dataProvider(value:DataProvider):void

示例
如何使用示例

下例创建一个新的 TileList,并使用 addItem() 方法向其数据提供者添加项目:

import fl.controls.TileList;
import fl.data.DataProvider;

var dp:DataProvider = new DataProvider();
dp.addItem({label:"Image 1", source:"http://www.helpexamples.com/flash/images/image1.jpg"});
dp.addItem({label:"Image 2", source:"http://www.helpexamples.com/flash/images/image2.jpg"});
dp.addItem({label:"Image 3", source:"http://www.helpexamples.com/flash/images/image3.jpg"});

var myTileList:TileList = new TileList();
myTileList.dataProvider = dp;
myTileList.columnWidth = 100;
myTileList.rowHeight = 100;
myTileList.columnCount = 2;
myTileList.rowCount = 2;
myTileList.move(10, 10);
addChild(myTileList);

下例创建一个新的 TileList,并通过将 Array 对象传递给 DataProvider 构造函数向其数据提供者添加项目:

import fl.controls.TileList;
import fl.data.DataProvider;

var itemsArray:Array = new Array();
itemsArray.push({label:"Image 1", source:"http://www.helpexamples.com/flash/images/image1.jpg"});
itemsArray.push({label:"Image 2", source:"http://www.helpexamples.com/flash/images/image2.jpg"});
itemsArray.push({label:"Image 3", source:"http://www.helpexamples.com/flash/images/image3.jpg"});

var dp:DataProvider = new DataProvider(itemsArray);

var myTileList:TileList = new TileList();
myTileList.dataProvider = dp;
myTileList.columnWidth = 100;
myTileList.rowHeight = 100;
myTileList.columnCount = 2;
myTileList.rowCount = 2;
myTileList.move(10, 10);
addChild(myTileList);

下例创建一个新的 TileList,并通过将 XML 对象传递给 DataProvider 构造函数向其数据提供者添加项目:

import fl.controls.TileList;
import fl.data.DataProvider;

var itemsXML:XML = <items>
        <item label="Image 1" source="http://www.helpexamples.com/flash/images/image1.jpg" />
        <item label="Image 2" source="http://www.helpexamples.com/flash/images/image2.jpg" />
        <item label="Image 3" source="http://www.helpexamples.com/flash/images/image3.jpg" />
    </items>;

var dp:DataProvider = new DataProvider(itemsXML);

var myTileList:TileList = new TileList();
myTileList.dataProvider = dp;
myTileList.columnWidth = 100;
myTileList.rowHeight = 100;
myTileList.columnCount = 2;
myTileList.rowCount = 2;
myTileList.move(10, 10);
addChild(myTileList);
direction属性 
direction:String  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置一个值,该值指示 TileList 组件是水平滚动还是垂直滚动。 ScrollBarDirection.HORIZONTAL 值指示 TileList 组件水平滚动;ScrollBarDirection.VERTICAL 值指示 TileList 组件垂直滚动。

默认值为 ScrollBarDirection.VERTICAL.


实现
    public function get direction():String
    public function set direction(value:String):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并将其滚动方向设置为垂直:

import fl.controls.ScrollBarDirection;
import fl.controls.TileList;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var myTileList:TileList = new TileList();
myTileList.addItem({label:"Image 1", source:baseURL + "image1.jpg"});
myTileList.addItem({label:"Image 2", source:baseURL + "image2.jpg"});
myTileList.addItem({label:"Image 3", source:baseURL + "image3.jpg"});
myTileList.direction = ScrollBarDirection.VERTICAL;
myTileList.columnWidth = 100;
myTileList.rowHeight= 67;
myTileList.columnCount = 1;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);
iconField属性 
iconField:String  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置用于提供项的图标的项字段。

注意:iconField 不在 iconFunction 属性设置为回调函数时使用。

图标可以是类也可以是库中具有类名称的元件。

默认值为 null.


实现
    public function get iconField():String
    public function set iconField(value:String):void

另请参见


示例
如何使用示例

下例在平铺列表中各项目的标签旁边分别创建一个图标。 该图标必须是库中名为 MyIcon 的元件,并且必须在其元件属性中选中“为 ActionScript 导出”:
import fl.controls.TileList;
import fl.controls.listClasses.CellRenderer;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var myTileList:TileList = new TileList();
myTileList.addItem({src:baseURL + "image1.jpg", iconSrc:MyIcon });
myTileList.addItem({src:baseURL + "image2.jpg", iconSrc:MyIcon });
myTileList.addItem({src:baseURL + "image3.jpg", iconSrc:MyIcon });
myTileList.labelField = "src";
myTileList.labelFunction = myLabelFunction;
myTileList.setStyle('cellRenderer', CellRenderer);    
myTileList.iconField = "iconSrc";
myTileList.columnWidth = 100;
myTileList.rowHeight = 67;
myTileList.columnCount = myTileList.length;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);

function myLabelFunction(item:Object):String {
    var fileName:String = item.src;
    var filePath:Array = fileName.split("/");
    return filePath.pop();
}
iconFunction属性 
iconFunction:Function  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置用于获得项的图标的函数。

注意:iconField 不在 iconFunction 属性设置为回调函数时使用。

图标可以是类,也可以是具有类名称的库项目。

默认值为 null.


实现
    public function get iconFunction():Function
    public function set iconFunction(value:Function):void

另请参见


示例
如何使用示例

下例只在平铺列表中第二个项目的旁边创建图标,方法是使用函数确定 image2.jpg 是否是该项目的来源。 该图标必须是库中名为 MyIcon 的元件,并且必须在其元件属性中选中“为 ActionScript 导出”:
import fl.controls.TileList;
import fl.controls.listClasses.CellRenderer;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var myTileList:TileList = new TileList();
myTileList.addItem({src:baseURL + "image1.jpg" });
myTileList.addItem({src:baseURL + "image2.jpg" });
myTileList.addItem({src:baseURL + "image3.jpg" });
myTileList.labelField = "src";
myTileList.labelFunction = myLabelFunction;
myTileList.setStyle('cellRenderer', CellRenderer);    
myTileList.iconFunction = myIconFunction;
myTileList.columnWidth = 100;
myTileList.rowHeight = 67;
myTileList.columnCount = myTileList.length;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);

function myLabelFunction(item:Object):String {
    var fileName:String = item.src;
    var filePath:Array = fileName.split("/");
    return filePath.pop();
}

function myIconFunction(item:Object):Class {
    if(item.src == baseURL + "image2.jpg") {
        return MyIcon;
    }
    else {
        return null;
    }
}
innerHeight属性 
innerHeight:Number  [read-only]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取内容区域的高度,以像素为单位。 如果水平滚动条可见,该值为组件高度减去 contentPadding 值与水平滚动条的总高度。


实现
    public function get innerHeight():Number

另请参见

innerWidth属性 
innerWidth:Number  [read-only]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取内容区域的宽度,以像素为单位。 如果垂直滚动条可见,该值为组件宽度减去 contentPadding 值与垂直滚动条的总宽度。


实现
    public function get innerWidth():Number

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,每当调度该组件的 resize 事件时就跟踪其 innerWidthinnerHeight 属性:

import fl.controls.ScrollBarDirection;
import fl.controls.TileList;
import fl.events.ComponentEvent;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var myTileList:TileList = new TileList();
myTileList.addItem({label:"Image 1", source:baseURL + "image1.jpg"});
myTileList.addItem({label:"Image 2", source:baseURL + "image2.jpg"});
myTileList.addItem({label:"Image 3", source:baseURL + "image3.jpg"});
myTileList.direction = ScrollBarDirection.VERTICAL;
myTileList.addEventListener(ComponentEvent.RESIZE, resizeHandler);
myTileList.columnWidth = 100;
myTileList.rowHeight= 67;
myTileList.columnCount = 1;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);

function resizeHandler(event:ComponentEvent):void {
    var myTL:TileList =  event.currentTarget as TileList;
    trace("resize:");
    trace("\t" + "width:", myTL.width);
    trace("\t" + "height:", myTL.height);
    trace("\t" + "innerHeight:", myTL.innerHeight);
    trace("\t" + "innerWidth:", myTL.innerWidth);
}
labelField属性 
labelField:String  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

在包含各拼贴的标签的各项中获取或设置一个字段。

注意:labelField 不在 labelFunction 属性设置为回调函数时使用。

默认值为 "label".


实现
    public function get labelField():String
    public function set labelField(value:String):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并设置 labelFieldsourceField 属性:

import fl.controls.TileList;
import fl.data.DataProvider;

var imagesXML:XML = <images>
        <img src="http://www.helpexamples.com/flash/images/image1.jpg" alt="Image 1" />
        <img src="http://www.helpexamples.com/flash/images/image2.jpg" alt="Image 2" />
        <img src="http://www.helpexamples.com/flash/images/image3.jpg" alt="Image 3" />
    </images>;

var dp:DataProvider = new DataProvider(imagesXML);

var myTileList:TileList = new TileList();
myTileList.dataProvider = dp;
myTileList.labelField = "alt";
myTileList.sourceField = "src";
myTileList.move(10, 10);
addChild(myTileList);
labelFunction属性 
labelFunction:Function  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取一个函数,该函数显示项的多个字段,用于提供拼贴的标签文本。

注意:labelField 不在 labelFunction 属性设置为回调函数时使用。

默认值为 null.


实现
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并创建一个自定义标签函数以返回所加载图像的文件名:

import fl.controls.TileList;
import fl.data.DataProvider;

var imagesXML:XML = <images>
        <img src="http://www.helpexamples.com/flash/images/image1.jpg" />
        <img src="http://www.helpexamples.com/flash/images/image2.jpg" />
        <img src="http://www.helpexamples.com/flash/images/image3.jpg" />
    </images>;

var dp:DataProvider = new DataProvider(imagesXML);

var myTileList:TileList = new TileList();
myTileList.dataProvider = dp;
myTileList.labelFunction = myLabelFunction;
myTileList.sourceField = "src";
myTileList.columnWidth = 100;
myTileList.rowHeight = 67; 
myTileList.columnCount = 3;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);

function myLabelFunction(item:Object):String {
    var fileName:String = item.src;
    var filePath:Array = fileName.split("/");
    return filePath.pop();
}
rowCount属性 
rowCount:uint  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置在列表中至少部分可见的行的行数。

设置 rowCount 属性将改变列表的高度,但 TileList 组件不会保持该值。 设置 rowCount之前请先设置 dataProviderrowHeight 值,这一点非常重要。 唯一例外的是通过属性检查器设置 rowCount 的情况;在这种情况下,在第一次绘制组件之前将保持该属性。

默认值为 0.


实现
    public function get rowCount():uint
    public function set rowCount(value:uint):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并设置 columnCountrowCount 属性以创建图像的网格:

import fl.controls.TileList;
import fl.data.DataProvider;

var baseURL:String = "http://www.helpexamples.com/flash/images/gallery1/thumbnails/";

var imagesArray:Array = new Array();
var i:uint;
for (i = 20; i < 30; i++) {
    imagesArray.push({source:baseURL + "pic" + i + ".jpg", label:"Image " + i});
}

var dp:DataProvider = new DataProvider(imagesArray);

var myTileList:TileList = new TileList();
myTileList.dataProvider = dp;
myTileList.columnWidth = 150;
myTileList.rowHeight = 100; 
myTileList.columnCount = 3;
myTileList.rowCount = 2;
myTileList.move(10, 10);
addChild(myTileList);
rowHeight属性 
rowHeight:Number  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置应用于列表中每一行的高度,以像素为单位。

默认值为 50.


实现
    public function get rowHeight():Number
    public function set rowHeight(value:Number):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并以 2x2 网格显示指定图像:

import fl.controls.TileList;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var myTileList:TileList = new TileList();
myTileList.addItem({label:"Image 1", source:baseURL + "image1.jpg"});
myTileList.addItem({label:"Image 2", source:baseURL + "image2.jpg"});
myTileList.addItem({label:"Image 3", source:baseURL + "image3.jpg"});
myTileList.columnWidth = 100;
myTileList.rowHeight = 67;
myTileList.columnCount = 2;
myTileList.rowCount = 2;
myTileList.move(10, 10);
addChild(myTileList);
scrollPolicy属性 
scrollPolicy:String  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置 TileList 组件的滚动策略。 该值用于指定由 direction 属性设置的滚动条的滚动策略。

注意:TileList 组件只支持在一个方向上滚动。 调整平铺内容使之适合组件的可查看区域,以便平铺内容仅在一个方向上隐藏。

只有当用户手动设置大小或用户设置 rowCountcolumnCount 属性时 TileList 组件才调整大小以适合平铺内容。

当该值设置为 ScrollPolicy.AUTO 时,滚动条仅在必须滚动 TileList 组件以显示所有项目时可见。

默认值为 ScrollPolicy.AUTO.


实现
    public function get scrollPolicy():String
    public function set scrollPolicy(value:String):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并将 scrollPolicy 设置为始终打开:

import fl.controls.ScrollPolicy;
import fl.controls.TileList;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var myTileList:TileList = new TileList();
myTileList.addItem({label:"Image 1", source:baseURL + "image1.jpg"});
myTileList.addItem({label:"Image 2", source:baseURL + "image2.jpg"});
myTileList.addItem({label:"Image 3", source:baseURL + "image3.jpg"});
myTileList.columnWidth = 100;
myTileList.rowHeight = 67;
myTileList.scrollPolicy = ScrollPolicy.ON;
myTileList.columnCount = 4;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);
sourceField属性 
sourceField:String  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置用于提供拼贴的源路径的项字段。

注意:sourceField 不在 sourceFunction 属性设置为回调函数时使用。

默认值为 "source".


实现
    public function get sourceField():String
    public function set sourceField(value:String):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并设置 labelFieldsourceField 属性:

import fl.controls.ScrollPolicy;
import fl.controls.TileList;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var myTileList:TileList = new TileList();
myTileList.addItem({alt:"Image 1", src:baseURL + "image1.jpg"});
myTileList.addItem({alt:"Image 2", src:baseURL + "image2.jpg"});
myTileList.addItem({alt:"Image 3", src:baseURL + "image3.jpg"});
myTileList.labelField = "alt";
myTileList.sourceField = "src";
myTileList.columnWidth = 100;
myTileList.rowHeight = 67;
myTileList.columnCount = myTileList.length;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);
sourceFunction属性 
sourceFunction:Function  [read-write]

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

获取或设置用于获得拼贴的源路径的函数。

注意:sourceField 不在 sourceFunction 属性设置为回调函数时使用。

默认值为 null.


实现
    public function get sourceFunction():Function
    public function set sourceFunction(value:Function):void

另请参见


示例
如何使用示例

下例创建一个 TileList 组件实例,并设置 sourceFunction 属性:

import fl.controls.ScrollPolicy;
import fl.controls.TileList;

var baseURL:String = "http://www.helpexamples.com/flash/images/";

var myTileList:TileList = new TileList();
myTileList.addItem({src:"image1.jpg"});
myTileList.addItem({src:"image2.jpg"});
myTileList.addItem({src:"image3.jpg"});
myTileList.labelField = "src";
myTileList.sourceFunction = mySourceFunction;
myTileList.columnWidth = 100;
myTileList.rowHeight = 67;
myTileList.columnCount = myTileList.length;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);

function mySourceFunction(item:Object):String {
    return baseURL + item.src;
}
构造函数详细信息
TileList()构造函数
public function TileList()

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

创建新的 List 组件实例。

方法详细信息
getStyleDefinition()方法
public static function getStyleDefinition():Object

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

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

返回
Object — 默认样式对象。

另请参见


示例
如何使用示例

下例为多个组件类创建一个样式浏览器:
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;
}
itemToLabel()方法 
public function itemToLabel(item:Object):String

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

基于 labelFieldlabelFunction 属性检索渲染器将为给定数据对象显示的字符串。

参数

item:Object — 要呈现的对象。

返回
String — 根据数据要显示的字符串。

另请参见

scrollToIndex()方法 
public override function scrollToIndex(newCaretIndex:int):void

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

将列表滚动至位于指定索引处的项目。 如果索引超出范围,则滚动位置不发生变化。

参数

newCaretIndex:int — 要滚动到的索引位置。


示例
如何使用示例

下例创建一个 TileList 组件实例,并使用 Slider 组件在各图像之间滚动:

import fl.controls.ScrollPolicy;
import fl.controls.Slider;
import fl.controls.TileList;
import fl.data.DataProvider;
import fl.events.SliderEvent;

var dp:DataProvider = new DataProvider();
dp.addItem({label:"Image 1", source:"http://www.helpexamples.com/flash/images/image1.jpg"});
dp.addItem({label:"Image 2", source:"http://www.helpexamples.com/flash/images/image2.jpg"});
dp.addItem({label:"Image 3", source:"http://www.helpexamples.com/flash/images/image3.jpg"});
dp.addItem({label:"Image 4", source:"http://www.helpexamples.com/flash/images/image1.jpg"});
dp.addItem({label:"Image 5", source:"http://www.helpexamples.com/flash/images/image2.jpg"});
dp.addItem({label:"Image 6", source:"http://www.helpexamples.com/flash/images/image3.jpg"});

var myTileList:TileList = new TileList();
myTileList.dataProvider = dp;
myTileList.scrollPolicy = ScrollPolicy.OFF;
myTileList.columnWidth = 100;
myTileList.rowHeight = 67;
myTileList.columnCount = 3;
myTileList.rowCount = 1;
myTileList.move(10, 10);
addChild(myTileList);

var mySlider:Slider = new Slider();
mySlider.liveDragging = true;
mySlider.minimum = 0;
mySlider.maximum = dp.length - 1;
mySlider.snapInterval = 1;
mySlider.tickInterval = 1;
mySlider.width = myTileList.width;
mySlider.move(myTileList.x, myTileList.y + myTileList.height + 10);
mySlider.addEventListener(SliderEvent.CHANGE, changeHandler);
addChild(mySlider);

function changeHandler(event:SliderEvent):void {
    myTileList.scrollToIndex(event.value);
}
示例 如何使用示例

此示例演示了如何创建一个 TileList 实例,并用库中的元件动态填充其内容。

若要运行该示例,请按照下列步骤操作:

  1. 将 TileList 组件添加到库中。
  2. 绘制一个星形并由其创建一个名为“star”的影片剪辑元件。
  3. star 的元件属性中,选中“为 ActionScript 导出”框。
  4. 将该代码作为 TileListExample.as 另存到 FLA 文件所在的同一目录中。
  5. 将 FLA 文件中的 Document 类设置为 TileListExample。
package
{ 
    import fl.controls.TileList;
    import fl.data.DataProvider;
    import flash.display.Sprite;
    import flash.events.Event;
    
    public class TileListExample extends Sprite
    {
        public function TileListExample() {
            var dp:DataProvider = new DataProvider();
            var totalEntries:uint = 42;
            var i:uint;
            for(i=0; i<totalEntries; i++) {
                dp.addItem( { label:"star"+i, source:star, scaleContent:false} );            
            }
            
            var myTileList:TileList = new TileList();
            myTileList.allowMultipleSelection = true;
            myTileList.columnWidth = 125;
            myTileList.rowHeight = 150;
            myTileList.dataProvider = dp;
            myTileList.columnCount = 3;
            myTileList.rowCount = 1;
            myTileList.move(10,10);
            addChild(myTileList);
        }
    }
}




 

评论添加到页面后给我发送电子邮件 | 评论报告

当前页: http://livedocs.adobe.com/flash/9.0_cn/ActionScriptLangRefV3/fl/controls/TileList.html