<s:DataRenderer>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:DataRenderer Properties data="" Events dataChange="No default" />]]>
注意:在更高版本中可能会删除此类。
此属性为 Bindable;它分派“dataChange”事件
<s:TextArea>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:TextArea Properties heightInLines="Calculated default" [Spark theme only] textFlow="TextFlow" [Spark theme only] typicalText=null [Spark theme only] widthInChars="Calculated default" [Spark theme only] Styles horizontalScrollPolicy="auto" [Spark theme only] symbolColor="" verticalScrollPolicy="auto" [Spark theme only] />]]>
Spark 主题的外观使用 RichEditableText 类。这意味着,Spark TextArea 控件支持基于 Flash 文本引擎 (FTE) 的 Text Layout Framework (TLF) 库。组合后,可以在这些层上使用高质量的国际印刷效果和布局编辑文本。外观包括一个可以显示水平滚动条和垂直滚动条(用于滚动文本)的 Scroller,并支持使用鼠标滚轮垂直滚动。可以通过
Mobile 主题的外观使用 StyleableStageText 类。由于 StyleableStageText 使用本机文本字段,它可以在移动设备上实现更好的文本输入和操作体验,但您应该注意它有一些
可以使用
使用 CSS 样式(例如
对于 Spark 主题,可以通过
可以使用
对于 Mobile 主题,特定于软键盘的属性
Spark 主题的文本区域
Spark TextArea 控件和 MX TextArea 控件之间的最重要区别如下所示:
Spark TextArea 控件使用 TLF 面向对象模型的富文本,其中,诸如分段、段落、范围、超链接和图像等文本布局元素在运行时由 ActionScript 对象表示。可以通过编程方式访问或操纵这些对象。TLF 中用于表示富文本的中心对象是 TextFlow。通过将 TextArea 控件的
如果不需要显示含有多种格式的文本,请将 TextArea 的
编译时,可以将 TLF 标记标签放在 TextArea 标签内,如下例所示:
<s:TextArea>Hello <s:span fontWeight="bold">World!</s:span></s:TextArea>在此示例中,MXML 编译器设置了 TextArea
TextArea 控件不包含任何用于更改文本格式的用户界面,但是包含可以用于以编程方式设置文本格式的 API。例如,可以创建一个按钮,当单击该按钮时,选定文本可变为粗体。
默认文本格式由 CSS 样式确定,例如
可以使用样式控制 TextArea 内容的许多特征。以下是一些常用示例:
默认情况下,文本在控件的右边缘换行。如果文本超出了 TextArea 范围,会自动显示垂直滚动条。如果将
Spark TextArea 可以显示从左到右 (LTR) 书写的文本(如法语)、从右到左 (RTL) 书写的文本(如阿拉伯语)以及双向书写的文本(如阿拉伯语语句中的法语语句)。如果文本的主要书写方向为从右到左,请将
Spark TextArea 还支持在一个编辑会话内执行无限次撤消/重做操作。编辑会话在控件获得键盘焦点时启动,在控件失去焦点时结束。
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
对于 Spark 主题,TextArea 控件具有以下默认特性:
对于 Mobile 主题,TextArea 控件具有以下默认特性:
<s:TextArea>Hello <s:span fontWeight="bold">World</s:span></s:TextArea>在此示例中,指定为内容的 String 和 SpanElement 用于创建 TextFlow。
该属性的类型为 Object,因为可以将其设置为 String、FlowElement 或 String 和 FlowElement 的 Array。在上述示例中,内容为二元数组。第一个数组元素是字符串“Hello”。第二个数组元素是含有粗体文本“World”的 SpanElement 对象。
无论指定内容的方式为何,内容都会转换为 TextFlow 对象。当获得该属性的值时,即获得生成的 TextFlow 对象。
对于 Mobile 主题,它不受支持。
有关 Spark 主题,请参阅 spark.components.RichEditableText.heightInLines。
对于 Mobile 主题,它不受支持。
有关 Spark 主题,请参阅 spark.components.RichEditableText.textFlow。
对于 Mobile 主题,它不受支持。
有关 Spark 主题,请参阅 spark.components.RichEditableText.widthInChars。
对于 Mobile 主题,它不受支持。
<s:Grid>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Grid Properties />]]>
Grid 组件旨在用作 DataGrid 外观部件或其它自定义组合组件的元素。因此,它的外观不可以设置,它不包含滚动条且不提供默认的鼠标或键盘事件处理。
每个可见 Grid 单元格都由使用
Grid 控件根据
Grid 控件基于
Grid 控件支持平滑滚动。其垂直和水平滚动位置定义网格的可视部件的像素原点,网格的布局仅根据需要显示尽可能多的单元格项呈示器来填充可用空间。
Grid 控件支持基于项呈示器的内容自动计算其高度的高度可变的行。此支持称为网格虚拟化,因为从(像素)滚动位置到行和列索引的映射通常基于有关网格单元格的首选大小的不完整信息。Grid 缓存已滚动到视图的计算的行高度并基于单个
不支持 DataGrid 项呈示器中的转换。GridItemRenderer 类已禁用了其
以下示例函数使用此方法计算网格单元格的
function getCellData(x:Number, y:Number):Object { var cell:CellPosition = getCellAt(x, y); if (!cell) return null; var GridColumn:column = grid.columns.getItemAt(cell.columnIndex); return grid.dataProvider.getItemAt(cell.rowIndex)[column.dataField]; }
如果指定行的所有列和位于该行之前的所有行都尚未滚动到视图,则基于列的所有
如果指定行的所有列和位于该行之前的所有行都尚未滚动到可视范围内,则根据列的所有
如果指定行的所有列和位于该行之前的所有行都尚未滚动到可视范围内,则根据列的所有
如果指定列中的所有单元格尚未滚动到视图,则基于列的
如果网格的所有列或行尚未滚动到视图,则基于列的所有
如果未定义指定列的宽度属性,则返回的值可能只是一个近似值。只有列滚动到可视范围内之后,才会计算实际列宽。
如果请求的项呈示器不可见,则每次调用此方法时创建一个新的项呈示器。新的项呈示器不可见
如果指定的列不具有明显的宽度,则该单元格的宽度基于
如果网格属性
如果指定行的所有列和位于该行之前的所有行都尚未滚动到视图,则基于列的所有
如果网格的所有列或行尚未滚动到视图,则基于列的所有
以下示例函数使用此方法计算可见 GridColumn 对象的矢量。
function getVisibleColumns():Vector.<GridColumn> { var visibleColumns = new Vector.<GridColumn>; for each (var columnIndex:int in grid.getVisibleColumnIndices()) visibleColumns.push(grid.columns.getItemAt(columnIndex)); return visibleColumns; }
如果 columnIndex 为 -1,则整个行无效。同样,如果
当对位于
如果直接对
如果调用此方法后向
发生以下任一情况时该隐式“全选”模式将结束:
如果单元格区域没有完全包含在网格中,此方法不起作用。
每个索引表示要包含在选定内容中的数据提供程序中的一项。
网格事件处理函数应使用此属性记录最近未结合 Shift 键的鼠标按下或键盘事件的位置,该事件定义下一个潜在移动选择的一端。尖号索引定义另一端。
网格事件处理函数应使用此属性记录最近未结合 Shift 键的鼠标按下或键盘事件的位置,该事件定义下一个潜在移动选择的一端。尖号索引定义另一端。
如果
将
将
GridColumn 对象仅可以显示在单个 Grid 控件的
将
将
如果已显式设置网格的实际大小,则此属性不起作用。
如果以下任一项为 true,则此属性无效:
如果以下任一项为 true,则此属性无效:
如果以下任一项为 true,则此属性无效:
如果
如果已显式设置网格的实际大小,则此属性不起作用。
如果
如果
当用户通过与控件进行交互更改选定内容时,控件将分派
此属性可用于初始化或绑定到 MXML 标记中的选择。
当用户通过与控件进行交互更改选定内容时,控件将分派
此属性可用于初始化或绑定到 MXML 标记中的选择。
默认值为空
当用户通过与控件进行交互更改选定内容时,控件将分派
此属性可用于初始化或绑定到 MXML 标记中的选择。
当用户通过与控件进行交互更改选定内容时,控件将分派
此属性可用于初始化或绑定到 MXML 标记中的选择。setSelectedCell() 方法应用于程序选择更新,例如编写 keyboard 或 mouse 事件处理函数时。
>默认值为空
当用户通过与控件进行交互更改选定内容时,控件将分派
此属性可用于初始化或绑定到 MXML 标记中的选择。
当用户通过与控件进行交互更改选定内容时,控件将分派
此属性可用于初始化或绑定到 MXML 标记中的选择。setSelectedCell() 方法应用于程序选择更新,例如编写 keyboard 或 mouse 事件处理函数时。
默认值为空
更改 selectionMode 会导致清除当前选定内容,并将 caretRowIndex 和 caretColumnIndex 设置为 -1。
限制:如果
如果为
<s:Application>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Application Properties applicationDPI=Device dependent" backgroundColor="0xFFFFFF" colorCorrection="default" controlBarContent="null" controlBarLayout="HorizontalLayout" controlBarVisible="true" frameRate="24" pageTitle"" preloader="No default" preloaderChromeColor="No default" resizeForSoftKeyboard=true" runtimeDPIProvider="RuntimeDPIProvider" scriptRecursionLimit="1000" scriptTimeLimit="60" splashScreenImage="" splashScreenMinimumDisplayTime="1000" splashScreenScaleMode="none" usePreloader="true" viewSourceURL="" xmlns:No default="No default" Events applicationComplete="No default" error="No default" />]]>
Application 容器具有下列默认特征:
注意:无法使用 ActionScript 代码设置此属性;必须使用 MXML 代码进行设置。
注意:无法使用 ActionScript 代码设置此属性;必须使用 MXML 代码进行设置。MXML 代码中设置的值是为了供某个工具使用而设计的,用于更新随 SDK 提供的 HTML 模板。
注意:无法使用 ActionScript 代码设置此属性;必须使用 MXML 代码进行设置。
使用此属性指定用于定义自定义进度指示符的组件的路径。要创建自定义进度指示符,通常需要创建 SparkDownloadProgressBar 或 DownloadProgressBar 类的子类,或者创建用于实现 mx.preloaders.IPreloaderDisplay 接口的 flash.display.Sprite 类的子类。
注意:无法使用 ActionScript 代码设置此属性;必须使用 MXML 代码进行设置。
注意:无法使用 ActionScript 代码设置此属性;必须使用 MXML 代码进行设置。
注意:仅当已设置
注意:您必须将 frameworks\libs\mobile\mobilecomponents.swc 添加到应用程序的库路径中,以在桌面应用程序中支持启动屏幕。
未被图像覆盖的舞台部分显示的颜色为 Application 容器的
注意:仅当已设置
注意:您必须将 frameworks\libs\mobile\mobilecomponents.swc 添加到应用程序的库路径中,以在桌面应用程序中支持启动屏幕。
注意:无法使用 ActionScript 代码设置此属性;必须使用 MXML 代码进行设置。
仅允许主应用程序设置
注意:Application 容器不会监视
可以使用 for-in 循环来提取 parameters Object 中的所有名称和值。
参数有两个源:Application 的 URL 中的查询字符串和 FlashVars HTML 参数(仅适用于主 Application)的值。
要可以调整应用程序大小,您还必须将应用程序的 xml 描述符文件中的
Flex 的默认映射为:
splashScreenImage="@Embed('Default.png')"
注意:仅当
注意:您必须将 frameworks\libs\mobile\mobilecomponents.swc 添加到应用程序的库路径中,以在桌面应用程序中支持启动屏幕。
您必须使用 MXML(而非 ActionScript)设置
<Application viewSourceURL="http://path/to/source"> ... </Application>
<s:Button>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Button Properties emphasized="false" />]]>
当用户选择 Button 控件时,该控件通常使用事件侦听器来执行操作。当用户在 Button 控件上单击鼠标时,就会启用 Button 控件,此控件分派
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
Button 控件具有下列默认特征:
<s:CheckBox>
tag inherits all of the tag
attributes of its superclass and adds the following attributes:
<s:CheckBox Properties symbolColor="0x000000" />]]>
用户单击 CheckBox 组件或其关联文本时,CheckBox 组件会将其
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
CheckBox 控件具有下列默认特征:
<s:Group>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Group Properties blendMode="auto" mxmlContent="null" scaleGridBottom="null" scaleGridLeft="null" scaleGridRight="null" scaleGridTop="null" Events elementAdd="No default" elementRemove="No default" />]]>
为了改进性能和最小化应用程序大小,不能设置 Group 容器的外观。如果希望应用外观,请改用 SkinnableContainer。
注意:当 Group 内部存在 DisplayObject 子代(如组件或另一个 Group)时,刻度网格可能无法正常工作。如果子代是 GraphicElement 对象,并且全部共享该 Group 的 DisplayObject,则刻度网格将正常工作。
对 GraphicElement 子代设置下列任何属性要求 GraphicElement 创建其自己的 DisplayObject,从而使 Group 的刻度网格属性无效。
alpha blendMode other than BlendMode.NORMAL or "auto" colorTransform filters mask matrix rotation scaling 3D properties bounds outside the extent of the Group
Group 容器具有下列默认特征:
“auto”值(默认值)特定于 blendMode 的 Group 使用情况,并指明基础 blendMode 应为
内容项目仅应该是 IVisualElement 对象。因为可视元素一次仅可以处于一个容器中,所以不应该在多个 Group 容器之间共享
如果内容是一个 Array,不要直接修改该 Array。请改用由 Group 类定义的方法。
<s:TextInput>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:TextInput Properties widthInChars="Calculated default" [applies to Spark theme] Events enter="No default" />]]>
Spark 主题的 TextInput 外观使用 RichEditableText 类。这意味着 Spark TextInput 控件支持基于 Flash 文本引擎 (FTE) 的 Text Layout Framework (TLF) 库。组合后,可以在这些层上使用高质量的国际印刷效果和布局编辑文本。
Mobile 主题的 TextInput 外观使用 StyleableStageText 类而不是 RichEditableText。由于 StyleableStageText 使用本机文本字段,它可以在移动设备上实现更好的文本输入和操作体验,但您应该注意它有一些
可以使用
使用 CSS 样式(例如
对于 Spark 主题,您可以使用
可以使用
对于 Mobile 主题,特定于软键盘的属性
当用户按下 Enter 键,而不是插入换行符时,该控件分派
此控件是一个外观可变的控件,其默认外观包含 Spark 主题的一个 RichEditableText 实例或 Mobile 主题的一个 StyleableStageText 实例。它处理显示和编辑文本。(该外观还会处理绘制边框和背景。)此 RichEditableText 或 StyleableStageText 实例可以作为
对于 Spark 主题,由于其 RichEditableText 使用 TLF,Spark TextInput 控件支持显示从左到右 (LTR) 的文本(如法语)和从右到左 (RTL) 的文本(如阿拉伯语)以及双向文本(如阿拉伯语内出现法语短语)。如果文本的主要书写方向为从右到左,请将
此外,使用 TLF 后,Spark TextInput 还支持在一个编辑会话内执行无限次撤消/重做操作。编辑会话在控件获得键盘焦点时启动,在控件失去焦点时结束。
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
对于 Spark 主题,TextInput 控件具有以下默认特性:
对于 Mobile 主题,TextInput 控件具有以下默认特性:
em 是一种印刷测量单位,相当于一个点大小。em 并非必须完全精确等于字母“M”的宽度,但是在很多字体中,“M”大约为一个 em 宽。使用控件的
例如,如果需要 TextInput 的宽度足够输入约 20 个文本字符,则将该属性设置为 20。
如果指定显性宽度、百分比宽度或
如果已指定
对于 Mobile 主题,它不受支持。
<s:Form>
tag inherits all the tag
attributes of its superclass and adds no new tag attributes:
<s:Form> ... child tags ... </s:Form>]]>
下表描述了 Flex 中用于创建表单的组件:
如果从表单中删除后代,则不会更新字典。
<s:NumericStepper>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:NumericStepper Properties imeMode="null" maxChars="0" maximum="10" valueFormatFunction="" valueParseFunction="" Styles alignmentBaseline="USE_DOMINANT_BASELINE" baselineShift="0.0" blockProgression="TB" borderAlpha="0.5" borderColor="0x000000" borderVisible="true" breakOpportunity="AUTO" cffHinting="HORIZONTAL_STEM" color="0" contentBackgroundAlpha="1.0" contentBackgroundColor="0xFFFFFF" clearFloats="none" digitCase="DEFAULT" digitWidth="DEFAULT" direction="LTR" dominantBaseline="AUTO" firstBaselineOffset="AUTO" focusedTextSelectionColor="" fontFamily="Arial" fontLookup="DEVICE" fontSize="12" fontStyle="NORMAL" fontWeight="NORMAL" inactiveTextSelection="" justificationRule="AUTO" justificationStyle="AUTO" kerning="AUTO" leadingModel="AUTO" ligatureLevel="COMMON" lineHeight="120%" lineThrough="false" listAutoPadding="40" listStylePosition="outside" listStyleType="disc" locale="en" paragraphEndIndent="0" paragraphSpaceAfter="0" paragraphSpaceBefore="0" paragraphStartIndent="0" renderingMode="CFF" tabStops="null" textAlign="START" textAlignLast="START" textAlpha="1" textDecoration="NONE" textIndent="0" textJustify="INTER_WORD" textRotation="AUTO" trackingLeft="0" trackingRight="0" typographicCase="DEFAULT" unfocusedTextSelectionColor="" whiteSpaceCollapse="COLLAPSE" wordSpacing="100%,50%,150%" />]]>
NumericStepper 控件包括一个单行输入文本字段和一对用于逐一显示可能值的箭头按钮。还可使用向上箭头键和向下箭头键以及鼠标滑轮遍历这些值。当用户按 Enter 键,从组件删除焦点,或通过按箭头按钮或调用
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
NumericStepper 控件具有下列默认特征:
spark.skins.spark.NumericStepperTextInputSkin
flash.system.IMEConversionMode 类定义此属性的有效值的常量。您还可以指定
此函数包含下列签名:
funcName(value:Number):String
此函数包含下列签名:
funcName(value:String):Number
<s:Spinner>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Spinner Properties allowValueWrap="false" Events change="No default" Styles cornerRadius="2" focusAlpha="0.5" focusColor="0x70B2EE" symbolColor="0x000000" />]]>
Spinner 由两个必需按钮组成,一个用于增大当前值,一个用于减小当前值。用户还可使用向上箭头键和向下箭头键或鼠标滚轮遍历这些值。当用户按 Enter 键,从组件删除焦点,或通过按箭头按钮或调用
Spinner 组件的范围是
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
Spinner 控件具有下列默认特征:
组件可以更改它自己的尺寸(
组件的另一个选项是更改其比例,在这种情况下子项根本不需要更改。
组件始终调整它自己的大小,然后按照布局或用户指定的实际大小布置其子项。
组件始终调整它自己的大小,然后按照其测量大小布置其子项。对该比例进行调整以与由布局或用户指定的大小相匹配。
<s:NavigatorContent>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:NavigatorContent Properties icon="null" label="" />]]>
不要在 MX 导航器容器外使用 NavigatorContent 容器。
NavigatorContent 容器的创建策略基于其父导航器容器的创建策略:
NavigatorContent 容器不支持排队的创建策略。
NavigatorContent 容器具有下列默认特征:
例如,如果此 Container 是 TabNavigator 的一个子项,则此图标将显示在相应的选项卡中。如果此 Container 是 Accordion 的一个子项,则此图标将显示在相应的标题中。
要将图标嵌入到 SWF 文件中,请使用 @Embed() MXML 编译器指令:
icon="@Embed('filepath')"
图像可以是 JPEG、GIF、PNG、SVG 或 SWF 文件。
例如,如果此 Container 是 TabNavigator 的一个子项,则此字符串将显示在相应的选项卡中。如果此 Container 是 Accordion 的一个子项,则此字符串将显示在相应的标题中。
<s:VSlider>
tag inherits all of the tag
attributes of its superclass and adds no tag attributes:
<s:VSlider/>]]>
滑块可以允许最小值和最大值之间连续范围内的值,也可以限制为最小值和最大值之间具体间隔处的值。它可以使用数据提示显示其当前值。
VSlider 控件具备下列默认特征:
spark.skins.spark.VSliderThumbSkin
spark.skins.spark.VSliderTrackSkin
<s:ToggleButton>
tag inherits all of the tag
attributes of its superclass and adds no tag attributes:
<s:ToggleButton/>]]>
可以使用
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
ToggleButton 控件具有下列默认特征:
<s:FormHeading>
tag inherits all the tag
attributes of its superclass and adds no new tag attributes:
<s:FormHeading Properties label="" Common Styles alignmentBaseline="baseline" baselineShift="0" cffHinting="0.0" color="0x000000" digitCase="default" digitWidth="default" direction="ltr" dominantBaseline="auto" fontFamily="Arial" fontLookup="embeddedCFF" fontSize="12" fontStyle="normal" fontWeight="normal" justificationRule="auto" justificationStyle="auto" kerning="false" ligatureLevel="common" lineBreak="toFit" lineHeight="120%" lineThrough="false%" locale="en" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" renderingMode="cff" textAlign="start" textAlignLast="start" textAlpha="1" textDecoration="start" textJustify="interWord" trackingLeft="0" trackingRight="00" typographicCase="default" verticalAlign="top" Mobile Styles leading="2" letterSpacing="0" />]]>
<s:HScrollBar>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:HScrollBar Properties viewport="" />]]>
尽管可以使用 HScrollBar 控件作为独立控件,但通常将其结合作为另一组组件的一部分来提供滚动功能。
HScrollBar 控件具有下列默认特征:
spark.skins.spark.HScrollBarThumbSkin
spark.skins.spark.HScrollBarTrackSkin
默认行为会按“步长”的事件
对事件调用
如果设置了
如果
<s:SkinnablePopUpContainer>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:SkinnablePopUpContainer Events close="No default" open="No default" />]]>
不需要创建 SkinnablePopUpContainer 容器作为其父容器的正常布局。它会作为弹出窗口显示在其父代的顶部。因此,您不必在应用程序的 MXML 代码中直接创建它。
而应经常在单独的 MXML 文件中创建它作为 MXML 组件。要显示该组件,请先创建 MXML 组件的实例,然后调用
要关闭该组件,请调用
SkinnablePopUpContainer 最初处于
SkinnablePopUpContainer 容器具有下列默认特征:
当容器从
该事件提供用于将 commit 信息从容器传递给事件侦听器的机制。一种常用使用方案是构建带有取消按钮的多选项对话框。当选择一个有效选项时,可以调用
当容器从
使用 SkinnablePopUpContainer 容器的
<s:DropDownList>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:DropDownList Properties prompt="" typicalItem="null" Events closed="No default" open="No default" />]]>
DropDownList 控件由锚点按钮、提示区域和下拉列表组成,使用锚点按钮可打开和关闭下拉列表。提示区域显示一个提示 String,或者显示下拉列表中的选定项目。
打开下拉列表时:
注意:基于 Spark List 的控件(Spark ListBase 类及其子类,如 ButtonBar、ComboBox、DropDownList、List 和 TabBar)不支持将 BasicLayout 类作为
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
DropDownList 控件具有下列默认特征:
该容器使用典型数据项目和关联的项呈示器来确定容器子项的默认大小。通过定义典型项目,容器不必在屏幕上绘制每个子项时来调整其大小。
设置此属性会设置布局的
限制:如果
注意:设置
<s:GridColumnHeaderGroup>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:GridColumnHeaderGroup Properties columnSeperator="null" dataGrid="null" downColumnIndex="-1" headerRenderer="null" hoverColumnIndex="-1" visibleSortIndicatorIndices="empty Vector.<int>" Styles paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" separatorAffordance="5" Events gridClick="No default" gridDoubleClick="No default" gridMouseDown="No default" gridMouseDrag="No default" gridMouseUp="No default" gridMouseRollOut="No default" gridMouseRollOver="No default" separatorClick="No default" separatorDoubleClick="No default" separatorMouseDrag="No default" separatorMouseUp="No default" separatorMouseRollOut="No default" separatorMouseRollOver="No default" />]]>
标题由类(由
如果指定列前的所有可视列尚未滚动到视图,则基于所有 Grid 的
如果网格的所有列或行尚未滚动到视图,则基于所有列的
如果请求的标题呈示器不可见,则每次调用此方法时创建一个新的标题呈示器。新的项呈示器不可见
返回的呈示器的宽度与 DataGrid/getItemRendererAt() 返回的项呈示器的宽度相同。
如果 x 坐标在分隔符水平中点的
分隔符索引与左侧的列索引相同,假设该组件的
如果网格的所有列或行尚未滚动到视图,则基于所有列的
visibleSortIndicatorIndices.indexOf(columnIndex) != -1
将
将
<s:PopUpAnchor>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:PopUpAnchor Properties displayPopUp="false" popUp="" popUpHeightMatchesAnchorHeight="false" popUpPosition="topLeft" popUpWidthMatchesAnchorWidth="false" />]]>
PopUpAnchor 控件具有下列默认特征:
默认情况下,Spark 控件的拖放指示符是跨越此控件宽度的实线。为放置目标创建自定义外观类可创建自定义拖放指示符。在您的外观类中,在外观类的 <fx:Declarations> 区域中创建名为
<s:List>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:List Properties allowMultipleSelection="false" dragEnabled="false" dragMoveEnabled="false" dropEnabled="false" selectedIndices="null" selectedItems="null" useVirtualLayout="true" Styles alternatingItemColors="undefined" borderAlpha="1.0" borderColor="0#CCCCCC" borderVisible="true" contentBackgroundColor="0xFFFFFF" downColor="0xA8C6EE" dragIndicator="ListItemDragProxy" dropIndicatorSkin="ListDropIndicator" rollOverColor="0xCEDBEF" selectionColor="0xA8C6EE" symbolColor="0x000000" />]]>
注意:基于 Spark List 的控件(Spark ListBase 类及其子类,如 ButtonBar、ComboBox、DropDownList、List 和 TabBar)不支持将 BasicLayout 类作为
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
List 控件具有下列默认特征:
此方法用于拖放副本。
如果覆盖
如果覆盖
不支持在
不支持在
如果将此属性设置为
不支持在
将此属性更改为“off”以外的任何值可能导致滚动位置立即发生变化以确保一个元素正确地“贴紧”到位置。这种滚动位置的变化不是动画
如果通过将
如果通过将
注意:此属性与 Flash Player 使用的
此属性通常为
如果设置为 true,且 List 外观包含 Scroller 外观部件,该值则由其下的 Scroller 代理。
如果该值为
如果为
<s:BorderContainer>
tag inherits all the tag attributes
of its superclass, and adds the following tag attributes:
<s:BorderContainer Properties backgroundFill="null" borderStroke="null" Styles backgroundImage="undefined" backgroundImageFillMode="scale" borderAlpha="1.0" borderColor="0xB7BABC" borderStyle="solid" borderVisible="true" borderWeight="1" cornerRadius="0" dropShadowVisible="false" />]]>
注意:因为使用 CSS 样式和类属性控制 BorderContainer 的外观,所以通常不会为该容器创建自定义外观。如果确实创建了自定义外观,外观类应当应用任何样式控制容器外观。
默认情况下,边框的笔触是圆形的。如果不喜欢圆角,请将笔触的
BorderContainer 容器具有下列默认特征:
下例使用
<s:BorderContainer cornerRadius="10"> <s:backgroundFill> <s:SolidColor color="red" alpha="1"/> </s:backgroundFill> </s:BorderContainer>
以下是设置
<s:BorderContainer cornerRadius="10"> <s:borderStroke> <mx:SolidColorStroke color="black" weight="3"/> </s:borderStroke> </s:BorderContainer>
项呈示器的主机组件可以使用
对于诸如 List 和 ButtonBar 等控件,可以使用
<s:VideoPlayer>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:VideoPlayer Properties autoDisplayFirstFrame="true" autoPlay="true" autoRewind="true" loop="false" muted="false" pauseWhenHidden="true" scaleMode="letterbox" source="" volume="1" Events bytesLoadedChange="No default" complete="No default" currentTimeChange="No default" durationChange="No default" mediaPlayerStateChange="No default" Styles alignmentBaseline="baseline" baselineShift="0" cffHinting="0.0" color="0x000000" digitCase="default" digitWidth="default" direction="ltr" dominantBaseline="auto" dropShadowVisible="true" fontFamily="Arial" fontLookup="device" fontSize="12" fontStyle="normal" fontWeight="normal" justificationRule="auto" justificationStyle="auto" kerning="false" ligatureLevel="common" lineHeight="120%" lineThrough="false%" locale="en" renderingMode="cff" textAlign="start" textAlignLast="start" textAlpha="1" textDecoration="start" textJustify="interWord" trackingLeft="0" trackingRight="00" typographicCase="default" />]]>
VideoPlayer 控件具有下列默认特征:
将源设置为 null 或发生播放错误时,可能无法分派此事件。
将源设置为 null 或发生播放错误时,可能无法分派此事件。
将源设置为 null 或发生播放错误时,可能无法分派此事件。
<s:ButtonBar>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:ButtonBar />]]>
按钮栏的典型用途是将一组相关按钮组合到一起,提供共同的外观和导航,并在一个位置处理
ButtonBar 控件可基于其
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
对于非手机项目,可以使用 ButtonBar 控件设置 ViewStack 容器的活动子代,如下例所示:
注意:基于 Spark List 的控件(Spark ListBase 类及其子类,如 ButtonBar、ComboBox、DropDownList、List 和 TabBar)不支持将 BasicLayout 类作为
<s:ButtonBar dataProvider="{myViewStack}" requireSelection="true" /> <mx:ViewStack id="myViewStack" borderStyle="solid"> <s:NavigatorContent id="search" label="Search"> <s:Label text="Search Screen"/> </s:NavigatorContent> <s:NavigatorContent id="custInfo" label="Customer Info"> <s:Label text="Customer Info"/> </s:NavigatorContent> <s:NavigatorContent id="accountInfo" label="Account Info"> <s:Label text="Account Info"/> </s:NavigatorContent> </mx:ViewStack>
ButtonBar 控件具有下列默认特征:
<s:Label>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Label Properties fontContext="" Styles alignmentBaseline="baseline" baselineShift="0" cffHinting="0.0" color="0x000000" digitCase="default" digitWidth="default" direction="ltr" dominantBaseline="auto" fontFamily="Arial" fontLookup="embeddedCFF" fontSize="12" fontStyle="normal" fontWeight="normal" justificationRule="auto" justificationStyle="auto" kerning="false" ligatureLevel="common" lineBreak="toFit" lineHeight="120%" lineThrough="false" locale="en" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" renderingMode="cff" textAlign="start" textAlignLast="start" textAlpha="1" textDecoration="start" textJustify="interWord" trackingLeft="0" trackingRight="00" typographicCase="default" verticalAlign="top" />]]>
在 Flash Player 中,使用 Flash 文本引擎 (FTE) 的 Label 提供高质量的国际印刷效果。因为 Label 运行速度快且占用内存少,所以它特别适合用于显示多个小型非交互式文本的情况,例如,项呈示器和 Button 外观中的标签。
Spark 体系结构提供三个文本“原型”(Label、RichText 和 RichEditableText)作为其“仅在用户需要时支付”基本原理的一部分。Label 运行速度最快且占用内存最少,但其功能有限:无复杂格式、不可滚动、不可选择、不可编辑且无超链接。RichText 和 RichEditableText 基于 Text Layout Framework (TLF) 库,而不是 FTE。RichText 新增了使用复杂格式程示 HTML 等富文本的功能,但仍然完全是非交互式的。RichEditableText 运行速度最慢且占用内存最多,但可以执行所有功能:支持使用虚拟化 TextLine 进行滚动、选择、编辑、超链接,以及从 URL 加载图像。您应该使用能够满足需求的最快速的文本原型。
Spark Label 控件与 MX Label 控件 mx.controls.Label 类似。最重要的区别在于:
在 Spark Label 中,将以下三个字符序列识别为显式换行符:CR(
如果没有为 Label 指定任何类型的宽度,则由这些显式换行符确定的最长行确定 Label 的宽度。
如果确实指定了某种类型的宽度,则指定文本将在组件边界的右边缘换行,因为
要禁用此自动换行,请将
如果文本超出了显示这些文本的空间,Label 可以截断文本。截断文本意味着使用截断指示符(如 "...")替换超额文本。请参阅继承的属性
可以使用
默认情况下,Label 没有背景,但是可以使用
Label 支持显示从左到右 (LTR) 书写的文本(如法语)、从右到左 (RTL) 书写的文本(如阿拉伯语)以及双向书写的文本(如阿拉伯语段落中的法语语句)。如果文本的主要书写方向为从右到左,可以将
Label 在 Flash 文本引擎中使用 TextBlock 类创建一个或多个 TextLine 对象,以采用由其 CSS 样式确定的格式静态显示其 text 字符串。由于性能原因,其 TextLine 不包含有关各个字型的信息;有关更多信息,请参阅 flash.text.engine.TextLineValidity.STATIC。
Label 控件具有下列默认特征:
<s:RichEditableText>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:RichEditableText Properties clipAndEnableScrolling="false|true" contentHeight="Calculated default" contentWidth="Calculated default" displayAsPassword="false" editable="true" heightInLines="NaN" horizontalScrollPosition="0" imeMode="null" maxChars="0" multiline="true" restrict="null" selectable="true" selectionActivePosition="-1" selectionAnchorPosition="-1" selectionHighlighting="TextSelectionHighlighting.WHEN_FOCUSED" text="" textFlow="TextFlow" typicalText=null verticalScrollPosition="0" widthInChars="NaN" Events change="No default" changing="No default" enter="No default" selectionChange="No default" />]]>
富文本可以包含可单击的超链接以及可嵌入或从 URL 加载的内嵌图形。
RichEditableText 不包含滚动条,但是可以实现用于以编程方式滚动的 IViewport 接口,这样可以由确实能够提供滚动条的 Scroller 控制。它还支持使用鼠标滚轮垂直滚动。
它不包括用于更改文本格式的任何用户界面。但是,它提供了可以通过编程方式执行此操作的 API;例如,这些 API 可以创建使所选文本变成粗体的 Bold 按钮。
该类用于 Spark 版本的 TextInput 和 TextArea 的外观。(TextInput 不显示处理富文本的功能,但 TextArea 可以。)默认情况下,RichEditableText 具有透明背景,但不支持绘制边框。
RichEditableText 使用 Text Layout Framework (TLF) 库,而该库又基于 Flash Player 10 中的 Flash 文本引擎 (FTE) 新版本。组合后,可以在这些层上使用高质量的国际印刷效果和布局编辑文本。
Spark 体系结构提供三个文本“原型”- Label、RichText 和 RichEditableText。Label 运行速度最快且占用内存最少,因为它仅使用 FTE,没有 TLF,但其功能有限:无富文本、不可滚动、不可选择、不可编辑。RichText 新增了使用复杂布局显示富文本的功能,但仍然完全是非交互式的。RichEditableText 占用内存最多,但是提供 TLF 可以执行的大部分功能。一般来说,请使用能够满足需求的最快速的文本原型。
RichEditableText 与用于 MX 组件的 UITextField 类相似。该类不使用 FTE 或 TLF,而是扩展了旧版 TextField 类。
UITextField 与 RichEditableText 之间最重要的区别在于:
RichEditableText 使用 TLF 面向对象模型的富文本,其中,诸如分段、段落、范围、超链接和图像等文本布局元素在运行时由 ActionScript 对象表示,可以通过编程方式访问和操纵该对象。TLF 中用于表示富文本的中心对象是 TextFlow,因此可以通过将要显示的 RichEditableText 控件的
编译时,可以将 TLF 标记标签放在 RichEditableText 标签内,如下例所示:
<s:RichEditableText>Hello <s:span fontWeight="bold">World!</s:span></s:RichEditableText>在此示例中,MXML 编译器设置了
默认文本格式由 CSS 样式确定,例如
使用
默认情况下,RichEditableText“自动调整大小”:最初不包含任何文本时非常小,随着文本的输入,其宽度不断增大直到
通过
当指定某种类型的宽度(无论是显式宽度或百分比宽度、
可以使用
如果不希望文本可编辑,请将
因为 RichEditableText 使用 TLF,所以它支持显示从左到右 (LTR) 书写的文本(如法语)、从右到左 (RTL) 书写的文本(如阿拉伯语)以及双向书写的文本(如阿拉伯语语句中的法语语句)。如果文本的主要书写方向为从右到左,请将
使用 TLF 后,RichEditableText 支持在一个编辑会话内执行无限次撤消/重做操作。编辑会话在组件获得键盘焦点时启动,在组件失去焦点时结束。
RichEditableText 使用 TLF 的 TextContainerManager 类处理其文本显示、滚动、选择、编辑和上下文菜单。
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
随后会在新文本之后设置插入点。如有必要,文本将滚动,以确保插入点可见。
如果格式在整个范围上设置不一致,则其值将为
可以为包含所需格式名称的 String 指定 Vector;如果不指定,将计算所有格式。
如果不指定范围,则将使用选定范围。
如果选择范围,新文本将替换所选文本。如果有插入点,将在该点插入新文本。
随后会在新文本之后设置插入点。如有必要,文本将滚动,以确保插入点可见。
如果任一位置为负,则它将取消选择该文本范围。
支持的格式是 TextLayoutFormat 中的那些格式。不应用
下面的示例设置所选项目的
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat(); textLayoutFormat.fontSize = 12; textLayoutFormat.color = 0xFF0000; myRET.setFormatOfRange(textLayoutFormat);
如果您使用
如果您希望指定一个要应用于所有文本的格式,最好对组件本身使用
下面的示例设置所有文本的
myRET.setStyle("fontSize", 12); myRET.setStyle("color", 0xFF0000);
由于 Text Layout Framework 将 TextLine 虚拟化以获得更佳性能,因此如果组件无法显示所有文本,则此初始高度将为估计值。如果滚动到文本末尾,所有 TextLine 将合成,且
要在内容中垂直滚动,请在 0 和
由于 Text Layout Framework 将 TextLine 虚拟化以获得更佳性能,因此如果组件无法显示所有文本,则此初始宽度将为估计值。如果滚动到文本末尾,所有 TextLine 将合成,且
要在文本中水平滚动,请在 0 和
<s:RichEditableText>Hello <s:span fontWeight="bold"/>World</s:span></s:RichEditableText>且可以将指定为内容的 String 和 SpanElement 用于创建 TextFlow。
该属性的类型为 Object,因为可以将其设置为 String、FlowElement 或 String 和 FlowElement 的 Array。在上述示例中,所指定的内容是二元数组,其中,第一个元素是字符串“Hello”,第二个元素是含有粗体文本“World”的 SpanElement。
无论指定内容的方式为何,内容都会转换为 TextFlow,且当获得该属性时,即获得生成的 TextFlow。
Adobe 建议运行时使用
如果为
如果该属性为
控件的格式样式(例如
例如,如果需要 RichEditableText 的高度足够显示 5 行文本,则将该属性设置为 5。
如果该属性为
如果指定显式高度、百分比高度或
如果已指定
RichEditableText 的
由于
要在文本中水平滚动,请在 0 和
flash.system.IMEConversionMode 类定义此属性的有效值的常量。您还可以指定
如果为
允许选择文本将使您能够从控件中复制文本。
如果
活动位置可以是选区的起点或终点。
例如,如果拖动选择位置 12 到位置 8 之间的区域,则
值为 -1 时,表示“未设置”。
锚点位置可以是选区的起点或终点。
例如,如果拖动选择位置 12 到位置 8 之间的区域,则
值为 -1 时,表示“未设置”。
所允许的值由 spark.components.TextSelectionHighlighting 类指定。可能的值有
TextFlow 是 Text Layout Framework (TLF) 中最重要的类。它是表示富文本内容的 FlowElement 的树的根。
通常情况下,使用
设置该属性会影响
如果设置
如果将
如果文本包含显式换行符 - CR(“\r”)、LF(“\n”)或 CR+LF(“\r\n”)- 则内容将设置为包含多个段落且各段落之间含一个间距的 TextFlow。
设置该属性也会影响用于指定控件的滚动位置和所选文本的属性。它将
要将 TextFlow 对象变成 TLF 标记,请使用
单个 TextFlow 无法由 RichEditableText 的多个实例共享。要在第二个实例中显示相同的文本,必须使用以下方法再创建一个 TextFlow:使用
设置该属性会影响
如果将
如果将
如果文本包含显式换行符 - CR(“\r”)、LF(“\n”)或 CR+LF(“\r\n”)- 则内容将设置为包含多个段落且各段落之间含一个间距的 TextFlow。
如果设置
设置该属性也会影响用于指定控件的滚动位置和所选文本的属性。它将
如果指定显性宽度、百分比宽度或
使用此属性将导致
要在内容中垂直滚动,请在 0 和
em 是一种印刷测量单位,相当于一个点大小。em 并非必须完全精确等于字母“M”的宽度,但是在很多字体中,“M”大约为一个 em 宽。使用控件的
例如,如果需要 RichEditableText 的宽度足够显示约 20 个文本字符,则将该属性设置为 20。
如果该属性为
如果指定显性宽度、百分比宽度或
如果已指定
RichEditableText 的
由于
Flex 不会自动关闭窗口。要支持关闭图标,您必须为
为该外观部件禁用焦点。
要拖动 TitleWindow 容器,请在窗口的标题栏区域中单击并按住鼠标指针,然后移动鼠标。创建自定义外观类以更改移动区域。
<s:TitleWindow>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:TitleWindow> Events close="No default" windowMove="No default" windowMoveEnd="No default" windowMoveStart="No default" windowMoving="No default" </s:TitleWindow>]]>
TitleWindow 设计为一个弹出窗口。请勿在 MXML 中将 TitleWindow 创建为应用程序的一部分,而是,通常根据 TitleWindow 类创建自定义 MXML 组件,然后使用
TitleWindow 容器具有以下默认大小特征:
<s:TabBar>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:TabBar Styles cornerRadius="4" />]]>
该组选项卡由
可以使用 TabBar 控件设置 ViewStack 容器的活动子代,如下例所示:
注意:基于 Spark List 的控件(Spark ListBase 类及其子类,如 ButtonBar、ComboBox、DropDownList、List 和 TabBar)不支持将 BasicLayout 类作为
<s:TabBar dataProvider="{myViewStack}"/> <mx:ViewStack id="myViewStack" borderStyle="solid"> <s:NavigatorContent id="search" label="Search"> <s:Label text="Search Screen"/> </s:NavigatorContent> <s:NavigatorContent id="custInfo" label="Customer Info"> <s:Label text="Customer Info"/> </s:NavigatorContent> <s:NavigatorContent id="accountInfo" label="Account Info"> <s:Label text="Account Info"/> </s:NavigatorContent> </mx:ViewStack>
TabBar 容器具有下列默认特征:
<s:RadioButton>
tag inherits all of the tag
attributes of its superclass, and adds the following tag attributes:
<s:RadioButton Properties enabled="" group="the automatically created default RadioButtonGroup" groupName="radioGroup" value="null" />]]>
RadioButton 组可以引用
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
RadioButton 组件具有以下默认特征:
创建要放入 RadioButtonGroup 中的单选按钮时,建议对所有按钮使用
项呈示器的主机组件可以使用
对于诸如 List 和 ButtonBar 等控件,可以使用
<s:Panel>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Panel Properties controlBarContent="null" controlBarLayout="HorizontalLayout" controlBarVisible="true" title="" Styles borderAlpha="0.5" borderColor="0" borderVisible="true" cornerRadius="0" dropShadowVisible="true" > ... child tags ... </s:Panel>]]>
Panel 容器具有下列默认特征:
注意:Panel 容器不会监视
<s:HGroup>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:HGroup Properties columnWidth="no default" gap="6" horizontalAlign="left" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" requestedColumnCount="-1" requestedMaxColumnCount="-1" requestedMinColumnCount="-1" variableColumnWidth"true" verticalAlign="top" />]]>
HGroup 容器具有下列默认特征:
定义项呈示器的类必须实现 IItemRenderer 接口。
最后,此方法应对项呈示器设置
<s:FormItem>
tag inherits all the tag
attributes of its superclass and adds no new tag attributes:
<s:FormItem Properties helpContent="null" label="" required="false" sequenceLabel="" Common Styles errorIndicatorSource="assets/ErrorIndicator.png" requiredIndicatorSource="assets/RequiredIndicator.png" Mobile Styles leading="2" letterSpacing="0" />]]>
此属性仅控制外观的状态。如果您需要输入验证,必须将验证程序指定给子项。
<s:SkinnableContainer>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:SkinnableContainer Properties autoLayout="true" creationPolicy="auto" layout="BasicLayout" Styles accentColor="0x0099FF" alignmentBaseline="useDominantBaseline" alternatingItemColors="" backgroundAlpha="1.0" backgroundColor="0xFFFFFF" baselineShift="0.0" blockProgression="TB" breakOpportunity="auto" cffHinting="horizontal_stem" clearFloats="none" color="0" contentBackgroundAlpha="" contentBackgroundColor="" digitCase="default" digitWidth="default" direction="LTR" dominantBaseline="auto" downColor="" firstBaselineOffset="auto" focusColor="" focusedTextSelectionColor="" fontFamily="Arial" fontLookup="device" fontSize="12" fontStyle="normal" fontWeight="normal" inactiveTextSelectionColor="0xE8E8E8" justificationRule="auto" justificationStyle="auto" kerning="auto" leadingModel="auto" ligatureLevel="common" lineHeight="120%" lineThrough="false" listAutoPadding="40" listStylePosition="outside" listStyleType="disc" locale="en" paragraphEndIndent="0" paragraphSpaceAfter="0" paragraphSpaceBefore="0" paragraphStartIndent="0" renderingMode="CFF" rollOverColor="" symbolColor="" tabStops="null" textAlign="start" textAlignLast="start" textAlpha="1" textDecoration="none" textIndent="0" textJustify="inter_word" textRotation="auto" trackingLeft="0" trackingRight="0" typographicCase="default" unfocusedTextSelectionColor="" verticalScrollPolicy="auto" whiteSpaceCollapse="collapse" wordSpacing="100%,50%,150%" Events elementAdd="No default" elementRemove="No default" />]]>
为了改进性能和最小化应用程序大小,可以使用 Group 容器。不能设置 Group 容器的外观。
SkinnableContainer 容器具有下列默认特征:
覆盖此函数以将行为附加到该部件。如果希望覆盖从某个基类继承的外观部件上的行为,请不要调用
覆盖此函数以从该部件删除行为。
<s:RichText>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:RichText Properties fontContext="IFlexModuleFactory" luminosityClip="false" luminosityInvert="false" maskType="MaskType.CLIP" textFlow="TextFlow" />]]>
由于性能原因,它不支持滚动、选择、编辑、可单击的超链接或从 URL 加载的图像。如果需要这些功能,请参阅 RichEditableText 类。
RichText 使用 Text Layout Framework (TLF) 库,而该库又基于 Flash Player 10 中的 Flash 文本引擎 (FTE)。组合后,它们可以提供使用高质量国际印刷效果的富文本布局。
Spark 体系结构提供三个文本“原型”- Label、RichText 和 RichEditableText。Label 运行速度最快且占用内存最少,因为它仅使用 FTE,没有 TLF,但其功能有限:无富文本、不可滚动、不可选择、不可编辑。RichText 新增了使用复杂布局显示富文本的功能,但仍然完全是非交互式的。RichEditableText 占用内存最多,但是提供 TLF 可以执行的大部分功能。您应该使用能够满足需求且占用最小内存的文本原型。
RichText 与 MX 控件 mx.controls.Text 相似。Text 控件使用旧版 TextField 类(而不是 TLF)来显示文本。
RichText 和 Text 之间最重要的区别是:
RichText 使用 TLF 面向对象模型的富文本,其中,诸如分段、段落、跨距和图像等文本布局元素在运行时由 ActionScript 对象表示,可以通过编程方式访问和操纵该对象。TLF 中用于表示富文本的中心对象是 TextFlow,因此可以通过将 RichText 的
编译时,可以将 TLF 标记标签放在 RichText 标签内,如下例所示:
<s:RichText>Hello <s:span fontWeight="bold">World!</s:span></s:RichText>在此示例中,MXML 编译器设置了
默认文本格式由 CSS 样式确定,例如
使用
如果没有为 RichText 指定任何类型的宽度,则由这些显式换行符确定的最长行确定 Label 的宽度。
当指定宽度时,文本将在组件的右边缘换行,且当文本超出了组件宽度时文本将会被剪切。如果将
如果文本超出了显示这些文本的空间,RichText 可以截断文本。截断文本意味着使用截断指示符(如 "...")替换超额文本。请参阅继承的属性
默认情况下,RichText 没有背景,但是可以使用
因为 RichText 使用 TLF,所以它支持显示从左到右 (LTR) 书写的文本(如法语)、从右到左 (RTL) 书写的文本(如阿拉伯语)以及双向书写的文本(如阿拉伯语语句中的法语语句)。如果文本的主要书写方向为从右到左,请将
RichText 使用 TLF 的 StringTextFlowFactory 类和 TextFlowTextLineFactory 类创建一个或多个 TextLine 对象,以静态显示其文本。由于性能原因,其 TextLine 不包含有关各个字型的信息;有关更多信息,请参阅 TextLineValidity 类。
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
<s:RichText>Hello <s:span fontWeight="bold"/>World</s:span></s:RichText>且可以将指定为内容的 String 和 SpanElement 用于创建 TextFlow。
该属性的类型为 Object,因为可以将其设置为 String、FlowElement 或 String 和 FlowElement 的 Array。在上述示例中,所指定的内容是二元数组,其中,第一个元素是字符串“Hello”,第二个元素是含有粗体文本“World”的 SpanElement。
无论指定内容的方式为何,内容都会转换为 TextFlow,且当获得该属性时,即获得生成的 TextFlow。
Adobe 建议运行时使用
maskType 定义将遮罩应用到组件的方式。
可能的值为
剪辑遮罩
遮罩处于剪辑模式下时,会将剪辑遮罩减少至 1 位。这意味着遮罩将不会影响源内容中像素的不透明度;它要么保留值不进行修改(如果遮罩中的相应像素具有非零 Alpha 值),要么使其完全透明(如果遮罩像素值为零 Alpha 值)。
使用剪辑遮罩时,仅遮罩定义的实际路径与形状矢量和填充用于确定源内容上的效果。会忽略遮罩上定义的笔触和位图滤镜。会将遮罩中任何填充的区域认为已填充,并呈示源内容。填充的类型和参数不相关;遮罩中的纯色填充、渐变填充或位图填充将全部呈示基础源内容,而与遮罩填充的 Alpha 值无关。
在剪辑遮罩中使用时,BitmapGraphics 被视为位图填充的矩形。结果,当遮罩的一部分(位图)按与相等尺寸的纯色填充矩形相同的方式影响遮罩时,源位图的 Alpha 通道不相关。
Alpha 遮罩
在 Alpha 模式下,会将源内容中的每个像素的不透明度与遮罩的相应区域的不透明度相乘。即,对于由不透明度为 0.5 的区域遮罩的、源内容中不透明度为 1 的像素,其结果不透明度将为 0.5。对于由不透明度为 0.5 的区域遮罩的、不透明度为 0.8 的源像素,其结果不透明度为 0.4。
从概念上讲,Alpha 遮罩等效于将转换的遮罩和源内容呈示到单独的 RGBA 表面中,并将遮罩内容的 Alpha 通道与源内容的 Alpha 通道相乘。在合成到源内容的表面中之前,会将所有遮罩内容呈示到其表面中。结果,所有 FXG 功能(如笔触、位图滤镜和填充不透明度)将影响最终合成的内容。
处于 Alpha 模式下时,会将任何位图数据的 Alpha 通道正常合成到遮罩 Alpha 通道中,并将影响最终呈示的内容。对于 BitmapGraphics 和位图填充的形状与路径,这保持 true。
发光度遮罩
发光度遮罩有时称为“柔化遮罩”,除以下方面外其作用极其类似于 Alpha 遮罩:源内容中像素的不透明度和 RGB 颜色值与遮罩中相应区域的不透明度和 RGB 颜色值相乘。
从概念上讲,发光度遮罩等效于将转换的遮罩和源内容呈示到单独的 RGBA 表面中,并将遮罩内容的 Alpha 通道和 RGB 颜色值与源内容的 Alpha 通道和 RGB 颜色值相乘。在合成到源内容的表面中之前,会将所有遮罩内容呈示到其表面中。结果,所有 FXG 功能(如笔触、位图滤镜和填充不透明度)将影响最终合成的内容。
发光度遮罩不是 Flash 的特有功能,但在诸如 Adobe Illustrator 和 Adobe Photoshop 等 Adobe Creative Suite 工具中通用。为了实现 Flash 呈示内容中发光度遮罩的视觉效果,指定发光度遮罩的图形元素实际上会实例化模仿发光度遮罩在 Adobe Creative Suite 工具中呈示时其可视外观的着色器滤镜。
由发光度遮罩设置遮罩的对象可以设置用于控制遮罩 RGB 颜色值和剪辑的属性。请参阅 luminosityInvert 和 luminosityClip 属性。
TextFlow 是 Text Layout Framework (TLF) 中最重要的类。它是表示富文本内容的 FlowElement 的树的根。
通常情况下,使用
设置该属性会影响
如果设置
如果将
如果文本包含显式换行符 - CR (
要将 TextFlow 对象转换为 TLF 标记,请使用从
<s:SkinnableDataContainer>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:SkinnableDataContainer Properties autoLayout="true" dataProvider="null" itemRenderer="null" itemRendererFunction="null" layout="VerticalLayout" typicalItem="null" Styles alignmentBaseline="useDominantBaseline" baselineShift="0.0" cffHinting="horizontal_stem" color="0" digitCase="default" digitWidth="default" direction="LTR" dominantBaseline="auto" focusAlpha="0.55" focusColor="" focusThickness="2" fontFamily="Arial" fontLookup="device" fontSize="12" fontStyle="normal" fontWeight="normal" justificationRule="auto" justificationStyle="auto" kerning="auto" ligatureLevel="common" lineHeight="120%" lineThrough="false" locale="en" renderingMode="CFF" textAlign="start" textAlignLast="start" textAlpha="1" textJustify="inter_word" trackingLeft="0" trackingRight="0" typographicCase="default" Events rendererAdd="No default" rendererRemove="No default" />]]>
SkinnableDataContainer 类充当子数据项目或实现 IVisualElement 接口且为 DisplayObject 的可视元素。数据项目可以是诸如 String 和 Number 对象等的简单数据项目,也可以是诸如 Object 和 XMLNode 对象等的更复杂的数据项目。尽管这些容器可以包含可视元素,但它们通常仅用于包含作为子项的数据项目。
项呈示器定义容器中数据项目的可视表示形式。项呈示器将数据项目转换为可以由容器显示的一种格式。必须将项呈示器传递给 SkinnableDataContainer 才能适当地呈示数据项目。
如果您需要一个数据项目容器而不需要外观,则建议使用 DataGroup(无法对其设置外观)来改善性能和应用程序大小。
SkinnableDataContainer 容器具有下列默认特征:
<s:Scroller>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Scroller Properties measuredSizeIncludesScrollBars="true" minViewportInset="0" viewport="null" Styles alignmentBaseline="use_dominant_baseline" alternatingItemColors="" baselineShift="0.0" blockProgression="TB" breakOpportunity="auto" cffHinting="horizontal_stem" clearFloats="none" color="0" contentBackgroundAlpha="" contentBackgroundColor="" digitCase="default" digitWidth="default" direction="LTR" dominantBaseline="auto" downColor="" firstBaselineOffset="auto" focusColor="" focusedTextSelectionColor="" fontFamily="Arial" fontLookup="device" fontSize="12" fontStyle="normal" fontWeight="normal" horizontalScrollPolicy="auto" inactiveTextSelection="" justificationRule="auto" justificationStyle="auto" kerning="auto" leadingModel="auto" ligatureLevel="common" lineHeight="120%" lineThrough="false" listAutoPadding="40" listStylePosition="outside" listStyleType="disc" locale="en" paragraphEndIndent="0" paragraphSpaceAfter="0" paragraphSpaceBefore="0" paragraphStartIndent="0" renderingMode="CFF" rollOverColor="" symbolColor="" tabStops="null" textAlign="start" textAlignLast="start" textAlpha="1" textDecoration="none" textIndent="0" textJustify="inter_word" textRotation="auto" trackingLeft="0" trackingRight="0" typographicCase="default" unfocusedTextSelectionColor="" verticalScrollPolicy="auto" whiteSpaceCollapse="collapse" wordSpacing="100%,50%,150%" />]]>
Spark Group、DataGroup 和 RichEditableText 组件实现 IViewport 接口,且可以用作 Scroller 控件的子代,如下例所示:
<s:Scroller width="100" height="100"> <s:Group> <mx:Image width="300" height="400" source="@Embed(source='assets/logo.jpg')"/> </s:Group> </s:Scroller>
Image 控件的大小比其父 Group 容器设置得大。默认情况下,子代超过父容器的边界。Scroller 会指定将子代剪切到边界并显示滚动条,而不是让子代超过父容器的边界。
并非所有 Spark 容器都会实现 IViewPort 接口。因此,BorderContainer 和 SkinnableContainer 等此类容器不能用作 Scroller 组件的直接子代。但是,所有 Spark 容器均可采用 Scroller 组件作为子组件。例如,要对 Spark BorderContainer 的子代使用滚动条,请将该子代包装在 Scroller 组件中。
要使整个 BorderContainer 可滚动,请将其包装在 Group 容器中。然后,将 Group 容器作为 Scroller 组件的子代,对于不能实现 IViewport 接口的可设置外观的 Spark 容器,还可以为包含 Scroller 组件的容器创建自定义外观。
IViewport 接口为实现该接口的组件定义视域。视区是您希望显示的容器区域的矩形子集,而不是显示整个容器。滚动条控制视域的
可以将滚动条与容器视域的显式设置结合使用。视域设置确定视域的初始位置,然后可以使用滚动条移动该位置,如下例所示:
<s:Scroller width="100" height="100"> <s:Group horizontalScrollPosition="50" verticalScrollPosition="50"> <mx:Image width="300" height="400" source="@Embed(source='assets/logo.jpg')"/> </s:Group> </s:Scroller>
滚动条是根据垂直和水平滚动条策略显示的,该策略可以为
Scroller 外观布局不能更改。它会无条件地设置为处理滚动策略的私有布局实现。Scroller 外观仅可以提供替换滚动条。要获得对视域及其滚动条的布局的更多控制功能,只需将它们添加到
Scroller 控件具有下列默认特征:
如果存在可视 verticalScrollBar,则默认情况下视口按
否则,如果存在可视 horizontalScrollBar,则默认情况下视口按
对事件调用
将其内容“回流”以适合可用宽度或高度的组件(例如 TextArea)可以使用该属性稳定其测量大小。默认情况,TextArea 由
在内容不回流的组件中(例如,典型的 List 项),默认行为更可取,因为组件内容被滚动条遮蔽的概率会更小。
将视域添加到 Scroller 组件的外观,该外观布置视域和滚动条。设置
<s:VGroup>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:VGroup Properties gap="6" horizontalAlign="left" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" requestedMaxRowCount="-1" requestedMinRowCount="-1" requestedRowCount"-1" rowHeight="no default" variableRowHeight="true" verticalAlign="top" />]]>
VGroup 容器具有下列默认特征:
<s:ComboBox>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:ComboBox Properties itemMatchingFunction="null" labelToItemFunction="null" maxChars="0" openOnInput="true" prompt="null" restrict="" Styles paddingBottom="3" paddingLeft="3" paddingRight="3" paddingTop="5" />]]>
这两个控件之间的一个区别是,ComboBox 控件的提示区域是使用 TextInput 控件实现的,而 DropDownList 控件是通过 Label 控件实现的。因此,用户可以编辑控件的提示区域,以输入非预定义选项之一的值。
例如,DropDownList 控件仅允许用户从控件的预定义项列表中进行选择。ComboBox 控件允许用户既可以从预定义项中选择,也可以在提示区域中输入新项。您的应用程序可以识别已输入一个新项,(可选)并将其添加到控件的项列表中。
ComboBox 控件还可以当用户在提示区域中输入字符时搜索项列表。当用户输入字符时,将打开控件的下拉区域,然后滚动到项列表中最接近的匹配项并加亮。
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
注意:基于 Spark List 的控件(Spark ListBase 类及其子类,如 ButtonBar、ComboBox、DropDownList、List 和 TabBar)不支持将 BasicLayout 类作为
ComboBox 控件具有以下默认特征:
spark.skins.spark.ComboBoxTextInputSkin
该属性引用的函数采用输入字符串,并返回数据提供程序中与输入相匹配的项的索引。这些项将在数据提供程序中。作为索引的 Vector <int> 返回。
该回调函数必须具有以下签名:
function myMatchingFunction(comboBox:ComboBox, inputText:String):Vector.<int>
如果该属性的值为 null,ComboBox 使用默认算法查找匹配项。默认情况下,如果长度为 n 的输入字符串等同于某项的前 n 个字符(忽略大小写),则它为该项的匹配项。例如,“aRiz”是“Arizona”的匹配项,而“riz”则不是。
要禁止搜索,请创建返回空 Vector.<int>。
先创建控件时将显示提示文本。控件获得焦点、输入文本为非 null 或选择了列表中的项目时提示文本将消失。控件失去焦点时提示文本将重新显示,但仅当未输入文本时(如果文本字段的值为 null 或空字符串)。
您可以使用 CSS 更改提示文本的样式。如果控件具有提示文本且未处于禁用状态,
以下示例 CSS 更改了 TextInput 控件中提示文本的颜色。ComboBox 控件将 TextInput 控件用作提示文本和输入的子组件,所以使用以下 CSS 时其提示文本会发生更改:
@namespace s "library://ns.adobe.com/flex/spark"; s|TextInput:normalWithPrompt { color: #CCCCFF; }
该回调函数必须具有以下签名:
function myLabelToItem(value:String):Object
其中,
默认回调函数返回
<s:Image>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:Image Properties clearOnLoad="true" contentLoader="null" contentLoaderGrouping="null" fillMode="scale" horizontalAlign="center" preliminaryHeight="NaN" preliminaryWidth="NaN" scaleMode="letterbox" smooth="false" source="null verticalAlign="middle" Styles backgroundAlpha="NaN" backgroundColor="NaN" enableLoadingState="false" smoothingQuality="default" Events complete="No default" httpStatus="No default" ioError="No default" progress="No default" ready="No default" securityError="No default" />]]>
注意:Flex 还提供了 SWFLoader 控件用于加载 Flex 应用程序。通常使用 Image 控件来加载静态图形文件和 SWF 文件,而 SWFLoader 用于加载 Flex 应用程序。Image 控件还可用于自定义项呈示器和项目编辑器。
注意:Flex 还包括 BitmapImage 类。该类用于将图像嵌入到外观和 FXG 组件。
嵌入的图像将立即加载,因为它们已经是 Flex SWF 文件的一部分。但是,这些图像会增加应用程序的大小,还会减慢应用程序的初始化过程。嵌入的图像还要求您在图像文件发生更改时立即重新编译应用程序。
如果不希望嵌入资源,也可以在运行时加载资源。您可以在运行 SWF 文件的本地文件系统中加载资源,也可以访问远程资源(通常是借助网络使用 HTTP 请求)。这些图像是独立于您的 Flex 应用程序的,因此,只要修改后的图像名称保持不变,修改图像就不会引发重新编译的操作。引用的图像不会延长应用程序的首次加载时间。但是,如果使用了这些图像并将其加载到 Flash Player 或 AIR,则可能会出现延迟。
默认外观可提供无镶边图像外观,该外观带有基于预加载器的通用进度栏和反映无效内容的错误的图像图标。
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
Image 控件具有下列默认特性:
请注意,对于通过加载器加载的内容,将分派
注意:不能保证分派
请注意,对于通过加载器加载的内容,将分派
<s:DataGroup>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:DataGroup Properties dataProvider="null" itemRenderer="null" itemRendererFunction="null" typicalItem="null" Events rendererAdd="No default" rendererRemove="No default" />]]>
DataGroup 类充当子数据项目或实现 IVisualElement 接口且为 DisplayObject 的可视元素。数据项目可以是诸如 String 和 Number 对象等的简单数据项目,也可以是诸如 Object 和 XMLNode 对象等的更复杂的数据项目。尽管这些容器可以包含可视元素,但它们通常仅用于包含作为子项的数据项目。
项呈示器定义容器中数据项目的可视表示形式。项呈示器将数据项目转换为可以由容器显示的一种格式。必须将项呈示器传递给 DataGroup 容器才能适当地呈示数据项目。
为了改进性能和最小化应用程序大小,不能设置 DataGroup 容器的外观。如果希望应用外观,请改用 SkinnableDataContainer。
DataGroup 容器具有下列默认特征:
如果
即使布局是虚拟的,也可以使用
无法保证返回的 Vector 中项的顺序。
请注意,VerticalLayout 和 HorizontalLayout 类提供可绑定的
如果直接对
给定一个数据项,则返回该数据项的
最后,此方法应对项呈示器设置
在 Flex 框架中包含多个 IList 实现,包括 ArrayCollection、ArrayList 和 XMLListCollection。
function myItemRendererFunction(item:Object):IFactory
该容器使用典型数据项目和关联的项呈示器来确定容器子项的默认大小。通过定义典型项目,容器不必在屏幕上绘制每个子项时来调整其大小。
设置此属性会设置布局的
限制:如果
<s:HSlider>
tag inherits all of the tag
attributes of its superclass and adds no tag attributes:
<s:HSlider/>]]>
滑块可以允许最小值和最大值之间连续范围内的值,也可以限制为最小值和最大值之间特定间隔处的值。滑块可以包含数据提示以显示其当前值。
HSlider 控件具有以下默认特征:
spark.skins.spark.HSliderThumbSkin
spark.skins.spark.HSliderTrackSkin
<s:DataGrid>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:DataGrid Properties columns="null" dataProvider="null" dataTipField="null" dataTipFunction="null" editable="false" editorColumnIndex="-1" editorRowIndex="-1" imeMode="null" itemEditor="null" itemRenderer="DefaultGridItemRenderer" preserveSelection="true" requestedColumnCount="-1" requestedMaxRowCount="-1" requestedMinColumnCount="-1" requestedMinRowCount="-1" requestedRowCount="-1" requireSelection="false" resizeableColumns="true" rowHeight="Calculated default" selectedCell="null" selectedCells="empty Vector.<CellPosition>" selectedIndex="null" selectedIndices="empty Vector.<CellPosition>" selectedItem="null" selectedItems="empty Vector.<Object>" selectionMode="singleRow" showDataTips="false" sortableColumns="true" typicalItem="null" variableRowHeight="false" Styles alignmentBaseline="useDominantBaseline" baselineShift="0.0" cffHinting="horizontalStem" color="0" defaultGridItemEditor="null" digitCase="default" digitWidth="default" direction="ltr" dominantBaseline="auto" fontFamily="Arial" fontLookup="device" fontSize="12" fontStyle="normal" fontWeight="normal" justificationRule="auto" justificationStyle="auto" kerning="auto" ligatureLevel="common" lineHeight="120%" lineThrough="false" locale="en" renderingMode="cff" stretchCursor="cursorStretch symbol from Assets.swf" textAlign="start" textAlignLast="start" textAlpha="1" textDecoration="none" textJustify="interWord" trackingLeft="0" trackingRight="0" typographicCase="default" verticalScrollPolicy="auto" Styles for the Spark Theme alternatingRowColors="undefined" borderAlpha="1.0" borderColor="0x696969" borderVisible="true" caretColor="0x0167FF" contentBackgroundAlpha="1.0" contentBackgroundColor="0xFFFFFF" rollOverColor="0xCEDBEF" selectionColor="0xA8C6EE" symbolColor="0x000000" Styles for the Mobile Theme leading="0" letterSpacing="0" selectionColor="0xE0E0E0" symbolColor="0x000000" Events caretChange="No default" gridClick="No default" gridDoubleClick="No default" gridItemEditorSessionCancel="No default" gridItemEditorSessionSave="No default" gridItemEditorSessionStart="No default" gridItemEditorSessionStarting="No default" gridMouseDown="No default" gridMouseDrag="No default" gridMouseUp="No default" gridMouseRollOut="No default" gridMouseRollOver="No default" selectionChange="No default" selectionChanging="No default" sortChange="No default" sortChanging="No default" />]]>
Spark DataGrid 控件实现为包装 Spark Grid 控件的可更换外观的包装器。Grid 控件定义数据网格的列,以及 DataGrid 控件自身的大部分功能。
DataGrid 外观负责布置网格、列标题和滚动条。外观也配置用于呈示可视元素(用作指示器、分隔符和背景)的图形元素。DataGrid 外观也定义默认项呈示器,用于显示每个单元格的内容。请参阅文档中相应呈示器类的信息以获得受支持样式的列表。
不支持 DataGrid 项呈示器中的转换。GridItemRenderer 类已禁用了其
如果取消该事件,则不会创建项编辑器。
当用户与此控件交互时,将分派此事件。通过编程方式对数据提供程序的集合进行排序时,此组件不会分派
DataGrid 控件包含针对此事件的默认处理函数(实现单列排序以及将网格的
通过调用
当用户与此控件交互时,将分派此事件。通过编程方式对数据提供程序的集合进行排序时,此组件不会分派
当用户与此控件交互时,将分派此事件。以编程方式更改选定内容时,组件不会分派
当用户与此控件交互时,将分派此事件。以编程方式更改选定内容时,组件不会分派
要处理该事件,请将事件处理函数指定给 DataGrid 控件的
要处理该事件,请将事件处理函数指定给 DataGrid 控件的
要处理该事件,请将事件处理函数指定给 DataGrid 控件的
要处理该事件,请将事件处理函数指定给 DataGrid 控件的
要处理该事件,请将事件处理函数指定给 DataGrid 控件的
要处理该事件,请将事件处理函数指定给 DataGrid 控件的
要处理该事件,请将事件处理函数指定给 DataGrid 控件的
要处理该事件,请将事件处理函数指定给 DataGrid 控件的
如果
如果
flash.system.IMEConversionMode 类定义此属性的有效值的常量。您还可以指定
若要在编辑项目时访问项目编辑器实例和新项目值,则应使用
不要在 MXML 中设置此属性。
<s:RadioButtonGroup>
tag inherits all of the
tag attributes of its superclass, and adds the following tag attributes:
<s:RadioButtonGroup Properties enabled="true" selectedValue="null" selection="null" Events change="No default" itemClick="No default" valueCommit="No default" />]]>
注意,RadioButtonGroup 组件是 EventDispatcher 的子类,而不是 UIComponent 的子类,并实现 IMXMLObject 接口。所有其它 Flex 可视组件实现 IVisualElement 接口。RadioButtonGroup 组件声明必须包含在
要在基于列表的组件(如 List 或 DataGrid)中使用此组件,请创建项呈示器。有关创建项呈示器的信息,请参阅
由于以编程方式进行更改会触发此事件,所以请确保任何
如果设置了
<s:VScrollBar>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:VScrollBar Properties viewport="" />]]>
虽然 VScrollBar 控件可以单独使用,但通常将它与其他组件一起使用来提供滚动功能。
VScrollBar 控件具有下列默认特征:
spark.skins.spark.VScrollBarThumbSkin
spark.skins.spark.VScrollBarTrackSkin
默认行为会按“步长”的事件
对事件调用
如果设置了
如果
<s:VideoDisplay>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:VideoDisplay Properties autoDisplayFirstFrame="true" autoPlay="true" autoRewind="true" loop="false" muted="false" pauseWhenHidden="true" scaleMode="letterbox" source="" volume="1" Events bytesLoadedChange="No default" complete="No default" currentTimeChange="No default" durationChange="No default" mediaPlayerStateChange="No default" />]]>
VideoDisplay 控件具有下列默认特征:
将源设置为 null 或发生播放错误时,可能无法分派此事件。
将源设置为 null 或发生播放错误时,可能无法分派此事件。
将源设置为 null 或发生播放错误时,可能无法分派此事件。
若要再次开始回放,请调用
如果时间小于 0 或 NaN,则会引发异常。如果时间已超过流末尾,或超过到目前为止已下载的文件的数量,则会尝试搜索,并在失败时进行恢复。
注意:对于流式下载,搜索总是转到指定的确切时间,即使 FLV 源文件在此处没有关键帧也是如此。
搜索是异步搜索,因此如果调用
如果
即使
如果
此属性对实时流视频不起作用。
如果禁用视频(或该视频的父代之一),该视频也将暂停,但如果重新启用该视频,则不会重新播放它。此行为并非通过
因为该视频可能正在搜索或缓冲,所以它可能当前并未播放,但它正在尝试播放。
如果未对组件指定任何宽度、高度或约束,则此属性不起作用。
对于渐进式下载,源仅是指定要播放的视频文件的路径或 URL。
对于流(录制流、实时流或多比特率流),source 属性是一个 DynamicStreamingVideoSource 对象。如果只希望播放不包含多比特率支持的录制流或实时流视频,则只需传入一个指向视频流的字符串 URL。但是,执行此操作后,会将 streamType 假定为“any”,并且您对流的控制能力不如使用 DynamicStreamingVideoSource 对象时那样强大。
注意:如果以前设置了源,不建议针对 MediaPlayerStateChangeEvent.LOADING 或 MediaPlayerStateChangeEvent.READY 设置源。这可能导致无限循环或 RTE。如果必须执行诸如此类的操作,请等待其它帧设置源。
如果源为
<s:TileGroup>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<s:TileGroup Properties columnAlign="left" columnCount="-1" columnWidth="0" horizontalAlign="justify" horizontalGap="6" orientation="rows" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" requestedColumnCount"-1" requestedRowCount="-1" rowAlign="top" rowCount="-1" rowHeight="0" verticalAlign="justify" verticalGap="6" />]]>
TileGroup 容器具有下列默认特征: