| 包 | fl.controls |
| 类 | public class TileList |
| 继承 | TileList SelectableList BaseScrollPane UIComponent Sprite DisplayObjectContainer InteractiveObject DisplayObject EventDispatcher Object |
| 实现 | IFocusManagerComponent |
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9.0.28.0 |
若要修改分隔图像单元格边框的填充,可以通过全局方式设置 imagePadding 样式,或者在 ImageCell 类上设置该样式。 与其它单元格样式一样,imagePadding 样式无法在 TileList 组件实例上进行设置。
另请参见
| 属性 | 定义方 | ||
|---|---|---|---|
![]() | accessibilityProperties : AccessibilityProperties
此显示对象的当前辅助功能选项。
| DisplayObject | |
![]() | allowMultipleSelection : Boolean
获取一个布尔值,指示能否一次选择多个列表项目。
| SelectableList | |
![]() | alpha : Number
指示指定对象的 Alpha 透明度值。
| DisplayObject | |
![]() | blendMode : String
BlendMode 类中的一个值,用于指定要使用的混合模式。
| DisplayObject | |
![]() | buttonMode : Boolean
指定此 sprite 的按钮模式。
| Sprite | |
![]() | cacheAsBitmap : Boolean
如果设置为 true,则 Flash Player 将缓存显示对象的内部位图表示形式。
| DisplayObject | |
| columnCount : uint
获取或设置在列表中至少部分可见的列的列数。
| TileList | ||
| columnWidth : Number
获取或设置应用于列表中列的宽度,以像素为单位。
| TileList | ||
![]() | constructor : Object
对类对象或给定对象实例的构造函数的引用。
| Object | |
![]() | contextMenu : ContextMenu
指定与此对象相关联的上下文菜单。
| InteractiveObject | |
| dataProvider : DataProvider
获取或设置要查看的项目列表的数据模型。
| TileList | ||
| direction : String
获取或设置一个值,该值指示 TileList 组件是水平滚动还是垂直滚动。
| TileList | ||
![]() | doubleClickEnabled : Boolean
指定此对象是否接收 doubleClick 事件。
| InteractiveObject | |
![]() | dropTarget : DisplayObject
[read-only]
指定拖动 sprite 时经过的显示对象,或放置 sprite 的显示对象。
| Sprite | |
![]() | enabled : Boolean
获取或设置一个值,该值指示组件是否可以接受用户交互。
| UIComponent | |
![]() | filters : Array
包含当前与显示对象关联的每个滤镜对象的索引数组。
| DisplayObject | |
![]() | focusEnabled : Boolean
获取或设置一个布尔值,该值指示组件是否可以在用户单击它后获得焦点。
| UIComponent | |
![]() | focusManager : IFocusManager
获取或设置为此组件及其同级组件控制焦点的 FocusManager。
| UIComponent | |
![]() | focusRect : Object
指定此对象是否显示焦点矩形。
| InteractiveObject | |
![]() | graphics : Graphics
[read-only]
指定属于此 sprite 的 Graphics 对象,在此 sprite 中可执行矢量绘画命令。
| Sprite | |
![]() | height : Number
获取或设置组件的高度,以像素为单位。
| UIComponent | |
![]() | hitArea : Sprite
指定一个 sprite 用作另一个 sprite 的点击区域。
| Sprite | |
![]() | horizontalLineScrollSize : Number
获取或设置一个值,该值描述当单击滚动箭头时要在水平方向上滚动的内容量。
| BaseScrollPane | |
![]() | horizontalPageScrollSize : Number
获取或设置按滚动条轨道时水平滚动条上滚动滑块要移动的像素数。
| BaseScrollPane | |
![]() | horizontalScrollBar : ScrollBar
[read-only]
获取对水平滚动条的引用。
| BaseScrollPane | |
![]() | horizontalScrollPolicy : String
获取或设置一个值,该值指示水平滚动条的状态。
| BaseScrollPane | |
![]() | horizontalScrollPosition : Number
获取或设置一个值,该值描述滚动窗格中水平滚动条的水平位置(以像素为单位)。
| BaseScrollPane | |
| iconField : String
获取或设置用于提供项的图标的项字段。
| TileList | ||
| iconFunction : Function
获取或设置用于获得项的图标的函数。
| TileList | ||
| innerHeight : Number
[read-only]
获取内容区域的高度,以像素为单位。
| TileList | ||
| innerWidth : Number
[read-only]
获取内容区域的宽度,以像素为单位。
| TileList | ||
| labelField : String
在包含各拼贴的标签的各项中获取或设置一个字段。
| TileList | ||
| labelFunction : Function
获取一个函数,该函数显示项的多个字段,用于提供拼贴的标签文本。
| TileList | ||
![]() | length : uint
[read-only]
获取数据提供者中的项目数。
| SelectableList | |
![]() | loaderInfo : LoaderInfo
[read-only]
返回一个 LoaderInfo 对象,其中包含加载此显示对象所属的文件的相关信息。
| DisplayObject | |
![]() | mask : DisplayObject
调用显示对象被指定的 mask 对象遮罩。
| DisplayObject | |
![]() | maxHorizontalScrollPosition : Number
获取或设置当 horizontalScrollPolicy 属性设置为 ScrollPolicy.ON 时,列表可以向右滚动的像素数。
| SelectableList | |
![]() | maxVerticalScrollPosition : Number
[read-only]
获取当前内容的最大垂直滚动位置(以像素为单位)。
| BaseScrollPane | |
![]() | mouseChildren : Boolean
确定对象的子项是否支持鼠标。
| DisplayObjectContainer | |
![]() | mouseEnabled : Boolean
指定此对象是否接收鼠标消息。
| InteractiveObject | |
![]() | mouseFocusEnabled : Boolean
获取或设置一个值,该值指示组件是否可以在用户单击它后获得焦点。
| UIComponent | |
![]() | mouseX : Number
[read-only]
指示鼠标位置的 x 坐标,以像素为单位。
| DisplayObject | |
![]() | mouseY : Number
[read-only]
指示鼠标位置的 y 坐标,以像素为单位。
| DisplayObject | |
![]() | name : String
指示 DisplayObject 的实例名称。
| DisplayObject | |
![]() | numChildren : int
[read-only]
返回此对象的子项数目。
| DisplayObjectContainer | |
![]() | opaqueBackground : Object
指定显示对象是否由于具有某种背景颜色而不透明。
| DisplayObject | |
![]() | parent : DisplayObjectContainer
[read-only]
指示包含此显示对象的 DisplayObjectContainer 对象。
| DisplayObject | |
![]() | prototype : Object
[static]
对类或函数对象的原型对象的引用。
| Object | |
![]() | root : DisplayObject
[read-only]
对于加载的 SWF 文件中的显示对象,root 属性是此 SWF 文件所表示的显示列表树结构部分中的顶级显示对象。
| DisplayObject | |
![]() | rotation : Number
指示 DisplayObject 实例距其原始方向的旋转程度,以度为单位。
| DisplayObject | |
| rowCount : uint
获取或设置在列表中至少部分可见的行的行数。
| TileList | ||
| rowHeight : Number
获取或设置应用于列表中每一行的高度,以像素为单位。
| TileList | ||
![]() | scale9Grid : Rectangle
当前有效的缩放网格。
| DisplayObject | |
![]() | scaleX : Number
将组件的当前宽度与缩放系数相乘。
| UIComponent | |
![]() | scaleY : Number
将组件的当前高度与缩放系数相乘。
| UIComponent | |
| scrollPolicy : String
获取或设置 TileList 组件的滚动策略。
| TileList | ||
![]() | scrollRect : Rectangle
显示对象的滚动矩形范围。
| DisplayObject | |
![]() | selectable : Boolean
获取或设置一个布尔值,指示列表中的项目是否可选。
| SelectableList | |
![]() | selectedIndex : int
获取或设置单选列表中的选定项目的索引。
| SelectableList | |
![]() | selectedIndices : Array
获取或设置一个数组,其中包含从多选列表中选定的项目。
| SelectableList | |
![]() | selectedItem : Object
获取或设置从单选列表中选择的项目。
| SelectableList | |
![]() | selectedItems : Array
获取或设置一个数组,其中包含多选列表中的选定项目的对象。
| SelectableList | |
![]() | soundTransform : SoundTransform
控制此 sprite 中的声音。
| Sprite | |
| sourceField : String
获取或设置用于提供拼贴的源路径的项字段。
| TileList | ||
| sourceFunction : Function
获取或设置用于获得拼贴的源路径的函数。
| TileList | ||
![]() | stage : Stage
[read-only]
显示对象的舞台。
| DisplayObject | |
![]() | tabChildren : Boolean
确定对象的子项是否支持 Tab 键。
| DisplayObjectContainer | |
![]() | tabEnabled : Boolean
指定此对象是否遵循 Tab 键顺序。
| InteractiveObject | |
![]() | tabIndex : int
指定 SWF 文件中的对象按 Tab 键顺序排列。
| InteractiveObject | |
![]() | textSnapshot : TextSnapshot
[read-only]
返回此 DisplayObjectContainer 实例的 TextSnapshot 对象。
| DisplayObjectContainer | |
![]() | transform : Transform
一个对象,具有与显示对象的矩阵、颜色转换和像素范围有关的属性。
| DisplayObject | |
![]() | useBitmapScrolling : Boolean
设置为 true 时,滚动内容的 cacheAsBitmap 属性设置为 true;设置为 false 时,该值会关闭。
| BaseScrollPane | |
![]() | useHandCursor : Boolean
布尔值,指示当鼠标滑过其 buttonMode 属性设置为 true 的 sprite 时是否显示手指形(手形光标)。
| Sprite | |
![]() | version : String = "3.0.0.13"
组件的版本号。
| UIComponent | |
![]() | verticalLineScrollSize : Number
获取或设置一个值,该值描述当单击滚动箭头时要在垂直方向上滚动多少像素。
| BaseScrollPane | |
![]() | verticalPageScrollSize : Number
获取或设置按滚动条轨道时垂直滚动条上滚动滑块要移动的像素数。
| BaseScrollPane | |
![]() | verticalScrollBar : ScrollBar
[read-only]
获取对垂直滚动条的引用。
| BaseScrollPane | |
![]() | verticalScrollPolicy : String
获取或设置一个值,该值指示垂直滚动条的状态。
| BaseScrollPane | |
![]() | verticalScrollPosition : Number
获取或设置一个值,该值描述滚动窗格中垂直滚动条的垂直位置(以像素为单位)。
| BaseScrollPane | |
![]() | visible : Boolean
获取或设置一个值,该值指示当前组件实例是否可见。
| UIComponent | |
![]() | width : Number
获取或设置组件的宽度(以像素为单位)。
| UIComponent | |
![]() | x : Number
获取或设置 x 坐标,该坐标表示组件在其父容器内沿 x 轴的位置。
| UIComponent | |
![]() | y : Number
获取或设置 y 坐标,该坐标表示组件在其父容器内沿 y 轴的位置。
| UIComponent | |
| 方法 | 定义方 | ||
|---|---|---|---|
|
TileList()
创建新的 List 组件实例。
| TileList | ||
![]() |
将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。
| DisplayObjectContainer | |
![]() |
将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。
| DisplayObjectContainer | |
![]() |
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
| EventDispatcher | |
![]() |
向项目列表的末尾追加项目。
| SelectableList | |
![]() |
在指定索引位置处将项目插入列表。
| SelectableList | |
![]() |
指示安全限制是否会导致出现以下情况:在列表中忽略了使用指定 point 点调用 DisplayObjectContainer.getObjectsUnderPoint() 方法时返回的所有显示对象。
| DisplayObjectContainer | |
![]() |
清除列表中渲染器上所设置的样式。
| SelectableList | |
![]() |
清除列表中当前所选的项目,并将 selectedIndex 属性设置为 -1。
| SelectableList | |
![]() |
删除此组件实例中的样式属性。
| UIComponent | |
![]() |
确定指定显示对象是 DisplayObjectContainer 实例的子项还是该实例本身。
| DisplayObjectContainer | |
![]() |
将事件调度到事件流中。
| EventDispatcher | |
![]() |
在此组件上显示或隐藏焦点指示符。
| UIComponent | |
![]() |
启动立即绘制操作,但不像 invalidateNow 那样使全部设置失效。
| UIComponent | |
![]() |
返回一个矩形,该矩形定义相对于 targetCoordinateSpace 对象坐标系的显示对象区域。
| DisplayObject | |
![]() |
返回位于指定索引处的子显示对象实例。
| DisplayObjectContainer | |
![]() |
返回具有指定名称的子显示对象。
| DisplayObjectContainer | |
![]() |
返回 DisplayObject 的 child 实例的索引位置。
| DisplayObjectContainer | |
![]() |
检索当前具有焦点的对象。
| UIComponent | |
![]() |
检索指定索引处的项目。
| SelectableList | |
![]() |
返回对象的数组,这些对象位于指定点下,并且是该 DisplayObjectContainer 实例的子项(或孙子项,依此类推)。
| DisplayObjectContainer | |
![]() |
返回一个矩形,该矩形根据 targetCoordinateSpace 参数定义的坐标系定义显示对象的边界,但不包括形状上的任何笔触。
| DisplayObject | |
![]() |
检索列表中渲染器上所设置的样式。
| SelectableList | |
![]() |
检索组件的样式查找链中设置的样式属性。
| UIComponent | |
|
[static]
检索当前组件的默认样式映射。
| TileList | ||
![]() |
将 point 对象从舞台(全局)坐标转换为显示对象的(本地)坐标。
| DisplayObject | |
![]() |
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
| EventDispatcher | |
![]() |
指示对象是否已经定义了指定的属性。
| Object | |
![]() |
计算显示对象,以确定它是否与 obj 显示对象重叠或相交。
| DisplayObject | |
![]() |
计算显示对象,以确定它是否与 x 和 y 参数指定的点重叠或相交。
| DisplayObject | |
![]() |
在未另外指定的情况下,将属性标记为无效,并在下一帧上重绘组件。
| UIComponent | |
![]() |
使特定项目渲染器失效。
| SelectableList | |
![]() |
使位于指定索引处的项目的渲染器失效。
| SelectableList | |
![]() |
使整个列表失效,强制重绘列表项目。
| SelectableList | |
![]() |
检查列表中的指定项目是否处于选中状态。
| SelectableList | |
![]() |
指示 Object 类的实例是否在指定为参数的对象的原型链中。
| Object | |
![]() |
为给定的项目对象(如果有)检索 ICellRenderer。
| SelectableList | |
|
基于 labelField 和 labelFunction 属性检索渲染器将为给定数据对象显示的字符串。
| TileList | ||
![]() |
将 point 对象从显示对象的(本地)坐标转换为舞台(全局)坐标。
| DisplayObject | |
![]() |
[static]
将多个类的样式合并到一个对象中。
| UIComponent | |
![]() |
将组件移动到其父项内的指定位置。
| UIComponent | |
![]() |
指示指定的属性是否存在、是否可枚举。
| Object | |
![]() |
删除列表中的所有项目。
| SelectableList | |
![]() |
从 DisplayObjectContainer 实例的子列表中删除指定的 child DisplayObject 实例。
| DisplayObjectContainer | |
![]() |
从 DisplayObjectContainer 的子列表中指定的 index 位置删除子 DisplayObject。
| DisplayObjectContainer | |
![]() |
从 EventDispatcher 对象中删除侦听器。
| EventDispatcher | |
![]() |
从列表中删除指定项目。
| SelectableList | |
![]() |
删除指定索引位置处的项目。
| SelectableList | |
![]() |
用其它项目替换指定索引位置处的项目。
| SelectableList | |
|
将列表滚动至位于指定索引处的项目。
| TileList | ||
![]() |
将列表滚动至由 selectedIndex 属性的当前值指示的位置处的项目。
| SelectableList | |
![]() |
更改现有子项在显示对象容器中的位置。
| DisplayObjectContainer | |
![]() |
设置此组件的焦点。
| UIComponent | |
![]() |
设置循环操作动态属性的可用性。
| Object | |
![]() |
设置列表中渲染器上的样式。
| SelectableList | |
![]() |
将组件设置为指定宽度和高度。
| UIComponent | |
![]() |
对此组件实例设置样式属性。
| UIComponent | |
![]() |
对当前数据提供者的元素进行排序。
| SelectableList | |
![]() |
以当前数据提供者的一个或多个字段为依据对其元素进行排序。
| SelectableList | |
![]() |
允许用户拖动指定的 Sprite。
| Sprite | |
![]() |
结束 startDrag() 方法。
| Sprite | |
![]() |
交换两个指定子对象的 Z 轴顺序(从前到后顺序)。
| DisplayObjectContainer | |
![]() |
在子级列表中两个指定的索引位置,交换子对象的 Z 轴顺序(前后顺序)。
| DisplayObjectContainer | |
![]() |
返回指定对象的字符串表示形式。
| Object | |
![]() |
验证并更新此对象的属性和布局,如果需要的话重绘对象。
| UIComponent | |
![]() |
返回指定对象的原始值。
| Object | |
![]() |
检查是否用此 EventDispatcher 对象或其任何始祖为指定事件类型注册了事件侦听器。
| EventDispatcher | |
| 样式 | 说明 | 定义方 | ||
|---|---|---|---|---|
|
cellRenderer
| 类型: Class 用于呈现 TileList 组件中的每个项目的单元格渲染器。 默认值为 fl.contols.listClasses.ImageCell. | TileList | ||
![]() | 类型: Number 格式: Length 用于分隔列表边框和列表内容的填充(以像素为单位)。 默认值为 null. | SelectableList | ||
![]() | 类型: Number 当 enabled 属性为 false 时将列表设置为的 Alpha 值。 默认值为 null. | SelectableList | ||
![]() | 类型: flash.text.TextFormat 用于在禁用了按钮的情况下呈现组件标签的 TextFormat 对象。 默认值为 TextFormat("_sans", 11, 0x999999, false, false, false, '', '', TextFormatAlign.LEFT, 0, 0, 0, 0). | UIComponent | ||
![]() | 类型: Class 类的名称,该类用作当禁用了滚动条时滚动条的向下箭头按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowDown_disabledSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作当单击滚动条的向下箭头按钮时该按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowDown_downSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作当鼠标指针在滚动条的向下箭头按钮上方时该按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowDown_overSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作滚动条的向下箭头按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowDown_upSkin. | BaseScrollPane | ||
![]() | 类型: Number 格式: Length 用于分隔组件的外边框和焦点指示符的外边框的填充(以像素为单位)。 默认值为 2. | UIComponent | ||
![]() | 类型: Class 用于显示焦点指示符的外观。 默认值为 focusRectSkin. | UIComponent | ||
![]() | 类型: Number 格式: Time 在第一次调度 buttonDown 事件之后、发送第二个 buttonDown 事件之前等待的毫秒数。. 默认值为 500. | BaseScrollPane | ||
![]() | 类型: Number 格式: Time 在由 repeatDelay 样式指定的延迟之后调度的 buttonDown 事件之间的间隔(以毫秒为单位)。. 默认值为 35. | BaseScrollPane | ||
|
skin
| 类型: Class 用作 TileList 组件背景的外观。 默认值为 TileList_skin. | TileList | ||
![]() | 类型: flash.text.TextFormat 用于呈现组件标签的 TextFormat 对象。 默认值为 TextFormat("_sans", 11, 0x000000, false, false, false, '', '', TextFormatAlign.LEFT, 0, 0, 0, 0). | UIComponent | ||
![]() | 类型: Class 用于指示缩略图的禁用状态的外观。. 默认值为 ScrollThumb_upSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作当单击滚动条的缩略图时该缩略图的外观。. 默认值为 ScrollThumb_downSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作滚动条的缩略图的图标。. 默认值为 ScrollBar_thumbIcon. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作当鼠标指针在滚动条的缩略图上方时该缩略图的外观。. 默认值为 ScrollThumb_overSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作滚动条的缩略图的外观。. 默认值为 ScrollThumb_upSkin. | BaseScrollPane | ||
![]() | 类型: Class 用于指示被禁用轨道的外观。. 默认值为 ScrollTrack_Skin. | BaseScrollPane | ||
![]() | 类型: Class 用于指示被禁用外观的按下状态的外观。. 默认值为 ScrollTrack_Skin. | BaseScrollPane | ||
![]() | 类型: Class 用于指示滚动轨道的鼠标悬停状态的外观。. 默认值为 ScrollTrack_Skin. | BaseScrollPane | ||
![]() | 类型: Class 用于指示滚动轨道的鼠标松开状态的外观。. 默认值为 ScrollTrack_Skin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作当禁用了滚动条时滚动条的向上箭头按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowUp_disabledSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作当单击滚动条的向上箭头按钮时该按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowUp_downSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作当鼠标指针在滚动条的向上箭头按钮上方时该按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowUp_overSkin. | BaseScrollPane | ||
![]() | 类型: Class 类的名称,该类用作滚动条的向上箭头按钮的外观。 如果以图形化方式或编程方式更改该外观,您应当确保新外观与轨道具有相同的高度(对于水平滚动条)或高度(对于垂直滚动条)。. 默认值为 ScrollArrowUp_upSkin. | BaseScrollPane | ||
| columnCount | 属性 |
columnCount:uint [read-write]
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9.0.28.0 |
获取或设置在列表中至少部分可见的列的列数。 设置 columnCount 属性将改变列表的宽度,但 TileList 组件不会保持该值。 设置 columnCount 值之前请先设置 dataProvider 和 rowHeight 值,这一点非常重要。 唯一例外的是通过属性检查器设置 rowCount 的情况;在这种情况下,在第一次绘制组件之前将保持该属性。
默认值为 0.
public function get columnCount():uint
public function set columnCount(value:uint):void
另请参见
columnCount 和 rowCount 属性来调整其大小:
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
另请参见
columnWidth 和 rowHeight 属性:
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
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);
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);
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
另请参见
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
另请参见
resize 事件时就跟踪其 innerWidth 和 innerHeight 属性:
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
另请参见
labelField 和 sourceField 属性:
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
另请参见
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 值之前请先设置 dataProvider 和 rowHeight 值,这一点非常重要。 唯一例外的是通过属性检查器设置 rowCount 的情况;在这种情况下,在第一次绘制组件之前将保持该属性。
默认值为 0.
public function get rowCount():uint
public function set rowCount(value:uint):void
另请参见
columnCount 和 rowCount 属性以创建图像的网格:
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
另请参见
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 组件只支持在一个方向上滚动。 调整平铺内容使之适合组件的可查看区域,以便平铺内容仅在一个方向上隐藏。
只有当用户手动设置大小或用户设置 rowCount 或 columnCount 属性时 TileList 组件才调整大小以适合平铺内容。
当该值设置为 ScrollPolicy.AUTO 时,滚动条仅在必须滚动 TileList 组件以显示所有项目时可见。
默认值为 ScrollPolicy.AUTO.
public function get scrollPolicy():String
public function set scrollPolicy(value:String):void
另请参见
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
另请参见
labelField 和 sourceField 属性:
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
另请参见
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 |
基于 labelField 和 labelFunction 属性检索渲染器将为给定数据对象显示的字符串。
参数
item:Object — 要呈现的对象。
|
String — 根据数据要显示的字符串。
|
另请参见
| scrollToIndex | () | 方法 |
public override function scrollToIndex(newCaretIndex:int):void
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9.0.28.0 |
参数
newCaretIndex:int — 要滚动到的索引位置。
|
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);
}
若要运行该示例,请按照下列步骤操作:
star 的元件属性中,选中“为 ActionScript 导出”框。
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