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

FlexNativeMenu  - AS3 Flex

x

顶级
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

语言元素

全局常量
全局函数
运算符
语句、关键字和指令
特殊类型

附录

新增内容
编译器错误
编译器警告
运行时错误
迁移到 ActionScript 3
支持的字符集
仅适用于 MXML 的标签
Motion XML 元素
Timed Text 标记
不推荐使用的元素的列表
AccessibilityImplementation 常量
如何使用 ActionScript 示例
法律声明
mx.controls
public class FlexNativeMenu
继承FlexNativeMenu Inheritance EventDispatcher Inheritance Object
实现 ILayoutManagerClient, IFlexContextMenu, IAutomationObject

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

FlexNativeMenu 组件为 AIR 的 NativeMenu 类提供包装。FlexNativeMenu 提供了一种使用 Flex 开发人员熟悉且与其他 Flex 菜单组件一致的技术定义本机操作系统菜单(如窗口、应用程序和上下文菜单)的方法,如使用 MXML 和数据提供程序指定菜单结构。然而,与 Flex 菜单组件不同,FlexNativeMenu 组件定义的菜单由主机操作系统作为 AIR 应用程序的一部分呈示,而不是由 Flex 作为可视组件创建。

与其他 Flex 菜单组件相同的是,要定义由 FlexNativeMenu 组件表示的菜单的结构,需要创建一个数据提供程序(如 XML 层次结构或对象数组),其中包含要用于定义该菜单的数据。可以设置多个属性来定义如何解释数据提供程序数据,如 labelField 属性指定用于菜单项标签的数据字段,keyEquivalentField 属性指定定义菜单项的键盘等效快捷方式的字段,mnemonicIndexField 属性指定标签中用作菜单项助记键字符的索引位置的字段。

FlexNativeMenu 项目的数据提供程序可以指定几个属性来确定项目的显示方式和行为方式,如以下 XML 数据提供程序所示:

   <mx:XML format="e4x" id="myMenuData">
     <root>
        <menuitem label="MenuItem A">
            <menuitem label="SubMenuItem A-1" enabled="False"/>
            <menuitem label="SubMenuItem A-2"/>
        </menuitem>
        <menuitem label="MenuItem B" type="check" toggled="true"/>
        <menuitem label="MenuItem C" type="check" toggled="false"/>
        <menuitem type="separator"/>
        <menuitem label="MenuItem D">
            <menuitem label="SubMenuItem D-1"/>
            <menuitem label="SubMenuItem D-2"/>
            <menuitem label="SubMenuItem D-3"/>
        </menuitem>
    </root>
 </mx:XML>

下表列出了您可以指定的属性及其数据类型、目的,以及数据提供程序表示它们必须采取的方式(如果菜单使用 DefaultDataDescriptor 类分析数据提供程序):

属性类型说明
altKey Boolean指定是否需要使用 Alt 键作为此项目等效键的一部分。
cmdKey Boolean 注意:从 Flex 3.2 起不再推荐使用此属性。请改用 commandKey。指定是否需要使用 Command 键作为此项目等效键的一部分。
commandKey Boolean指定是否需要使用 Command 键作为此项目等效键的一部分。
controlKey Boolean指定是否需要使用 Ctrl 键作为此项目等效键的一部分。
ctrlKey Boolean 注意:从 Flex 3.2 起不再推荐使用此属性。请改用 controlKey。指定是否需要使用 Ctrl 键作为此项目等效键的一部分。
enabled Boolean指定用户可以选择菜单项 (true),还是不可以选择菜单项 (false)。如果未指定,则 Flex 将假定该值为 true 来处理此项目。如果您使用默认数据说明符,则数据提供程序必须使用 enabledXML 属性或对象字段来指定此特征。
keyEquivalent 字符串指定一个键盘字符,当按下该字符时会像选择菜单项一样触发事件。菜单的 keyEquivalentFieldkeyEquivalentFunction 属性确定数据中指定等效键的字段名称,或确定等效键的函数。(如果数据提供程序采用 E4X XML 格式,则必须指定其中一个属性以分配等效键。)
label 字符串指定控件中显示的文本。此项目适用于除 separator 之外的所有菜单项类型。菜单的 labelFieldlabelFunction 属性确定数据中指定标签的字段名称,或确定标签的函数。(如果数据提供程序采用 E4X XML 格式,则必须指定其中一个属性以显示标签。)如果数据提供程序是字符串数组,则 Flex 使用字符串值作为标签。
mnemonicIndex 整型指定标签中用作菜单项助记键的字符的索引位置。菜单的 mnemonicIndexFieldmnemonicIndexFunction 属性确定数据中指定助记键索引的字段名称,或确定助记键索引的函数。(如果数据提供程序采用 E4X XML 格式,则必须指定这些属性之一,以便指定数据中的助记键索引。)此外,您可以紧挨着某个字符在其左侧添加下划线,以此指示标签中的该字符是菜单项的助记键。
shiftKey Boolean指定是否需要使用 Shift 键作为此项目等效键的一部分。
toggled Boolean指定是否选择了检查项目。如果未指定,则 Flex 处理该项目的方式将视同该值为 false 一样,并且该项目是不选中的。如果您使用默认数据说明符,则数据提供程序必须使用 toggledXML 属性或对象字段来指定此特征。
type 字符串指定菜单项的类型。有效值为 separatorcheck。Flex 将其他所有值或无类型条目的节点视为常规菜单条目。如果您使用默认数据说明符,则数据提供程序必须使用 typeXML 属性或对象字段来指定此特征。

要创建窗口菜单,请将 FlexNativeMenu 设置为窗口的 menu 属性,或者应在其上显示菜单的 WindowedApplication 实例。要创建应用程序菜单,请分配 FlexNativeMenu 作为应用程序的 WindowedApplication 的 menu 属性。要分配 FlexNativeMenu 作为部分用户界面的上下文菜单,请调用 FlexNativeMenu 实例的 setContextMenu() 方法,而将 UI 对象作为参数传递。调用 FlexNativeMenu 组件的 display() 方法,将该菜单显示为应用程序的任一窗口中的弹出菜单。

要检测何时会触发菜单项命令,请为 itemClick 事件注册侦听器。您还可以为 menuShow 事件注册侦听器以确定何时打开任何菜单或子菜单。

MXML 语法expanded隐藏 MXML 语法

The <mx:FlexNativeMenu> tag supports the following tag attributes:

  <mx:FlexNativeMenu
    Properties
    dataDescriptor="mx.controls.treeClasses.DefaultDataDescriptor"
    dataProvider="undefined"
    keyEquivalentField="keyEquivalent"
    keyEquivalentFunction="undefined"
    keyEquivalentModifiersFunction="undefined"
    labelField="label"
    labelFunction="undefined"
    mnemonicIndexField="mnemonicIndex"
    mnemonicIndexFunction="undefined"
    showRoot="true"
 
    Events
    itemClick="No default"
    menuShow="No default"
  />
  

相关 API 元素



公共属性
 属性由以下参数定义
      automationDelegate : Object
处理自动化相关功能的委托对象。
FlexNativeMenu
      automationEnabled : Boolean
[只读] 如果此组件启用了自动化,则为 true;否则为 false。
FlexNativeMenu
      automationName : String
可用作此对象的标识符的名称。
FlexNativeMenu
      automationOwner : DisplayObjectContainer
用于自动化目的的此组件的所有者。
FlexNativeMenu
      automationParent : DisplayObjectContainer
用于自动化目的的此组件的父级。
FlexNativeMenu
      automationTabularData : Object
[只读] IAutomationTabularData 接口的实现,可用于检索数据。
FlexNativeMenu
      automationValue : Array
[只读] 此值通常对应于对象的经呈示的外观,当对象在应用中以可视方式显示时,此值使标识符与该对象相关联。
FlexNativeMenu
      automationVisible : Boolean
[只读] 如果此组件对于自动化是可见的,则为 true;否则为 false。
FlexNativeMenu
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
      dataDescriptor : IMenuDataDescriptor
访问并处理数据提供程序中数据的对象。
FlexNativeMenu
      dataProvider : Object
用于定义 NativeMenu 中菜单项结构的对象的层次结构。
FlexNativeMenu
      hasRoot : Boolean
[只读] 一个标志,用于指明当前数据提供程序具有根节点;例如,层次结构中的单个顶级节点。
FlexNativeMenu
      initialized : Boolean
一个标志,用于确定某个对象是否已通过布局的所有三个阶段:提交、测量和布局(假设每个阶段都是必需的)。
FlexNativeMenu
      keyEquivalentField : String
数据提供程序中的字段名称,用以确定每个菜单项的等效键。
FlexNativeMenu
      keyEquivalentFunction : Function
确定每个菜单项等效键的函数。
FlexNativeMenu
      keyEquivalentModifiersFunction : Function
确定每个菜单项的等效功能键的函数。
FlexNativeMenu
      labelField : String
数据提供程序中的字段名称,用以确定每个菜单项的显示文本。
FlexNativeMenu
      labelFunction : Function
用于确定每个菜单项的显示文本的函数。
FlexNativeMenu
      mnemonicIndexField : String
数据提供程序中的字段名称,用以确定每个菜单项的助记键索引。
FlexNativeMenu
      mnemonicIndexFunction : Function
确定每个菜单项的助记键索引的函数。
FlexNativeMenu
      nativeMenu : NativeMenu
[只读] 返回由此对象管理的 flash.display.NativeMenu;如果不存在,则返回 null。
FlexNativeMenu
      nestLevel : int
此对象在所属关系层次结构中的深度。
FlexNativeMenu
      numAutomationChildren : int
[只读] 此容器包含的自动化子项数。
FlexNativeMenu
      processedDescriptors : Boolean
临时或延迟子项创建操作后设置为 true,具体取决于发生对象。
FlexNativeMenu
      showInAutomationHierarchy : Boolean
用于确定自动化对象是否显示在自动化层次中的标志。
FlexNativeMenu
      showRoot : Boolean
指定是否显示数据提供程序的根节点的布尔值标志。
FlexNativeMenu
      updateCompletePendingFlag : Boolean
一个标志,确定某个对象是否已通过所有三个阶段的布局验证(假设需要通过所有验证)。
FlexNativeMenu
公共方法
 方法由以下参数定义
  
    FlexNativeMenu()
构造函数。
FlexNativeMenu
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
  
返回标识此容器中的子项的一组属性。
FlexNativeMenu
  
返回标识此容器中的子项的一组属性。
FlexNativeMenu
 Inherited
将事件调度到事件流中。
EventDispatcher
  
    display(stage:Stage, x:int, y:int):void
在指定位置弹出此菜单。
FlexNativeMenu
  
在指定的索引位置提供自动化对象。
FlexNativeMenu
  
提供自动化对象列表。
FlexNativeMenu
 Inherited
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
EventDispatcher
 Inherited
表示对象是否已经定义了指定的属性。
Object
  
标记组件,以便在稍后屏幕更新期间调用该组件的 commitProperties() 方法。
FlexNativeMenu
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
  
重放指定的事件。
FlexNativeMenu
  
使用提供的 ID 解析子项。
FlexNativeMenu
  
将 InteractiveObject 的上下文菜单设置为基础本机菜单。
FlexNativeMenu
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
  
取消对已设为基础本机菜单的 InteractiveObject 上下文菜单的设置。
FlexNativeMenu
  
验证子项的位置和大小,并绘制其他可视内容。
FlexNativeMenu
  
    validateNow():void
验证并更新此对象的属性和布局,并重绘该对象(如果需要)。
FlexNativeMenu
  
验证组件的属性。
FlexNativeMenu
  
    validateSize(recursive:Boolean = false):void
如果使用此 ILayoutManagerClient 调用 LayoutManager.invalidateSize() 方法,随后在测量时调用了 validateSize() 方法,则验证组件的度量大小。
FlexNativeMenu
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。
EventDispatcher
受保护的方法
 方法由以下参数定义
  
处理对组件设置的属性。
FlexNativeMenu
  
基于 keyEquivalentField 和 keyEquivalentFunction 属性返回给定数据对象的等效键。
FlexNativeMenu
  
基于 keyEquivalentModifiersFunction 属性返回给定数据对象的等效功能键。
FlexNativeMenu
  
    itemToLabel(data:Object):String
基于 labelField 和 labelFunction 属性,返回用作给定数据对象的菜单项标签的字符串。
FlexNativeMenu
  
基于 mnemonicIndexField 和 mnemonicIndexFunction 属性,返回给定数据对象的助记键索引。
FlexNativeMenu
  
根据是否存在下划线字符从标签中提取助记键索引。
FlexNativeMenu
  
确定用于 NativeMenuItem 的实际标签,方法为删除下划线字符,然后转换转义下划线字符(如果存在)。
FlexNativeMenu
事件
 事件 摘要 由以下参数定义
 Inherited[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。EventDispatcher
 Inherited[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。EventDispatcher
  
    itemClick
选择菜单项时调度。FlexNativeMenu
  
    menuShow
显示菜单或子菜单前调度。FlexNativeMenu
属性详细信息
    

automationDelegate

属性
automationDelegate:Object

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

处理自动化相关功能的委托对象。



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

automationEnabled

属性 
automationEnabled:Boolean  [只读]

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

如果此组件启用了自动化,则为 true;否则为 false。



实现
    public function get automationEnabled():Boolean
    

automationName

属性 
automationName:String

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

可用作此对象的标识符的名称。



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

automationOwner

属性 
automationOwner:DisplayObjectContainer

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

用于自动化目的的此组件的所有者。



实现
    public function get automationOwner():DisplayObjectContainer
    public function set automationOwner(value:DisplayObjectContainer):void
    

automationParent

属性 
automationParent:DisplayObjectContainer

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

用于自动化目的的此组件的父级。



实现
    public function get automationParent():DisplayObjectContainer
    public function set automationParent(value:DisplayObjectContainer):void
    

automationTabularData

属性 
automationTabularData:Object  [只读]

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

IAutomationTabularData 接口的实现,可用于检索数据。



实现
    public function get automationTabularData():Object
    

automationValue

属性 
automationValue:Array  [只读]

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

此值通常对应于对象的经呈示的外观,当对象在应用中以可视方式显示时,此值使标识符与该对象相关联。



实现
    public function get automationValue():Array
    

automationVisible

属性 
automationVisible:Boolean  [只读]

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

如果此组件对于自动化是可见的,则为 true;否则为 false。



实现
    public function get automationVisible():Boolean
    

dataDescriptor

属性 
dataDescriptor:IMenuDataDescriptor

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

访问并处理数据提供程序中数据的对象。FlexNativeMenu 控件委托数据描述符提供其数据的相关信息。然后,这些数据用于分析和移动数据源。为 FlexNativeMenu 定义的数据描述符可供其所有子菜单和下级菜单使用。

如果要将此属性指定为 MXML 中的某个属性,则必须使用对数据描述符的引用,而不是描述符的字符串名称。请使用下列格式设置此属性:

<mx:FlexNativeMenu id="flexNativeMenu" dataDescriptor="{new MyCustomDataDescriptor()}"/>

或者,您可以在 MXML 中将该属性指定为嵌套子标签,如下例所示:

<mx:FlexNativeMenu>
      <mx:dataDescriptor>
         <myCustomDataDescriptor>
      </mx:dataDescriptor>
      ...

默认值为 DefaultDataDescriptor 类的内部实例。



实现
    public function get dataDescriptor():IMenuDataDescriptor
    public function set dataDescriptor(value:IMenuDataDescriptor):void
    

dataProvider

属性 
dataProvider:Object

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

用于定义 NativeMenu 中菜单项结构的对象的层次结构。各个数据对象定义菜单项,项目及其子项将成为菜单和子菜单。

FlexNativeMenu 控件按如下方式处理源数据对象:

  • 包含有效 XML 文本的字符串将转化为 XML 对象。
  • XMLNode 将转化为 XML 对象。
  • 将 XMLList 转换为 XMLListCollection。
  • 将实现 ICollectionView 接口的任何对象转换为 ICollectionView。
  • 将 Array 转换为 ArrayCollection。
  • 将任何其它类型的对象作为 Array 的唯一条目纳入该 Array 中。

默认值为 "undefined"。

此属性可用作数据绑定的源。修改此属性后,将调度 collectionChange 事件。



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

hasRoot

属性 
hasRoot:Boolean  [只读]

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

一个标志,用于指明当前数据提供程序具有根节点;例如,层次结构中的单个顶级节点。XML 和 Object 就是有根节点的类型的示例,而 List 和 Array 不是。



实现
    public function get hasRoot():Boolean
    

initialized

属性 
initialized:Boolean

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

一个标志,用于确定某个对象是否已通过布局的所有三个阶段:提交、测量和布局(假设每个阶段都是必需的)。



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

keyEquivalentField

属性 
keyEquivalentField:String

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

数据提供程序中的字段名称,用以确定每个菜单项的等效键。采用的一系列值在 Keyboard 类中以 KEYNAME_XXXX 常量定义。例如,查阅该列表了解控制字符(如 Home、Insert 等)的值。

设置 keyEquivalentFunction 属性将导致此属性被忽略。

默认值为 "keyEquivalent"。

此属性可用作数据绑定的源。修改此属性后,将调度 keyEquivalentChanged 事件。



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

相关 API 元素

    

keyEquivalentFunction

属性 
keyEquivalentFunction:Function

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

确定每个菜单项等效键的函数。如果省略此属性,则 Flex 将使用 keyEquivalentField 属性指定的字段或属性的内容。如果指定了此属性,则 Flex 将忽略任何 keyEquivalentField 属性值。

keyEquivalentFunction 属性适用于处理格式化、本地化和平台独立性。

等效功能键函数必须采用一个参数,该参数是数据提供程序中的项目,并且必须返回一个字符串。

myKeyEquivalentFunction(item:Object):String

默认值为 "undefined"。

此属性可用作数据绑定的源。修改此属性后,将调度 keyEquivalentFunctionChanged 事件。



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

相关 API 元素

    

keyEquivalentModifiersFunction

属性 
keyEquivalentModifiersFunction:Function

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

确定每个菜单项的等效功能键的函数。如果省略此属性,则 Flex 将使用其自身默认的函数来确定功能键的 Array,具体方法是在数据提供者数据中确定是否存在以下(布尔型)字段:altKeycommandKeycontrolKeyshiftKey

keyEquivalentModifiersFunction 属性适用于处理格式化、本地化和平台独立性。

等效功能键函数必须采用一个参数,该参数是数据提供程序中的项目,并且必须返回一个功能键名称数组。

myKeyEquivalentModifiersFunction(item:Object):Array

默认值为 "undefined"。

此属性可用作数据绑定的源。修改此属性后,将调度 keyEquivalentModifiersFunctionChanged 事件。



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

labelField

属性 
labelField:String

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

数据提供程序中的字段名称,用以确定每个菜单项的显示文本。如果数据提供程序是一个字符串 Array,则 Flex 会将每个字符串值作为标签使用。如果数据提供程序是一个 E4X XML 对象,则必须显式设置此属性。例如,如果 E4X XML 对象中的每个 XML 元素都包含一个“label”属性,其中包含每个菜单项的显示文本,则请将 labelField 设置为 "@label"

在标签中,您可以通过在字符前添加下划线指定将该字符用作助记键索引。例如,"C_ut" 标签值将助记键索引设置为 1。只有显示的第一个下划线具有此功能。若要在标签中显示文字下划线字符,您可以使用一条双下划线对其进行转义。例如,"C__u_t" 标签值可能会生成标签为“C_ut”、助记键索引为 3(“t”字符)的菜单项。如果存在由 mnemonicIndexField 属性定义的字段,并且设置为大于零的值,则此值将优先于任何用下划线指定的助记键索引值。

设置 labelFunction 属性将导致此属性被忽略。

默认值为 "label"。

此属性可用作数据绑定的源。修改此属性后,将调度 labelFieldChanged 事件。



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

labelFunction

属性 
labelFunction:Function

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

用于确定每个菜单项的显示文本的函数。标签函数必须在数据提供程序中查找一个或多个相应的字段,并返回一个可显示的字符串。

如果省略此属性,Flex 将使用 labelField 属性指定的字段或属性的内容。如果指定了此属性,则 Flex 将忽略任何 labelField 属性值。

labelFunction 属性有助于处理格式化、本地化和平台独立性。

标签函数必须采用一个参数,该参数是数据提供程序中的项目,并且必须返回一个字符串。

myLabelFunction(item:Object):String

默认值为 "undefined"。

此属性可用作数据绑定的源。修改此属性后,将调度 labelFunctionChanged 事件。



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

mnemonicIndexField

属性 
mnemonicIndexField:String

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

数据提供程序中的字段名称,用以确定每个菜单项的助记键索引。

如果此属性指定的字段中包含大于零的数值,则助记键索引将优先于标签中用下划线指定的索引。

设置 mnemonicIndexFunction 属性将导致此属性被忽略。

默认值为 "mnemonicIndex"。

此属性可用作数据绑定的源。修改此属性后,将调度 mnemonicIndexChanged 事件。



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

相关 API 元素

    

mnemonicIndexFunction

属性 
mnemonicIndexFunction:Function

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

确定每个菜单项的助记键索引的函数。

如果省略此属性,Flex 将使用 mnemonicIndexField 属性指定的字段或属性的内容。如果指定了此属性,则 Flex 将忽略任何 mnemonicIndexField 属性值。

如果已定义此属性,并且该函数针对数据项目返回大于零的数值,则返回的助记键索引将优先于标签中用下划线指定的索引。

mnemonicIndexFunction 属性适用于处理格式化、本地化和平台独立性。

助记键索引函数必须采用一个参数,该参数是数据提供程序中的项目,并且必须返回一个常量。

myMnemonicIndexFunction(item:Object):int

默认值为 "undefined"。

此属性可用作数据绑定的源。修改此属性后,将调度 mnemonicIndexFunctionChanged 事件。



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

nativeMenu

属性 
nativeMenu:NativeMenu  [只读]

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

返回由此对象管理的 flash.display.NativeMenu;如果不存在,则返回 null。如果更改菜单或基础数据提供程序,则可能会丢失直接对基础 NativeMenu 实例所做的任何更改。

此属性可用作数据绑定的源。修改此属性后,将调度 nativeMenuUpdate 事件。



实现
    public function get nativeMenu():NativeMenu
    

nestLevel

属性 
nestLevel:int

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

此对象在所属关系层次结构中的深度。测量和布局代码都使用此编号。如果 DisplayList 中没有此组件,则值为 0。



实现
    public function get nestLevel():int
    public function set nestLevel(value:int):void
    

numAutomationChildren

属性 
numAutomationChildren:int  [只读]

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

此容器包含的自动化子项数。此和不应包含任何复合子项,尽管它在自动化层次中确实包含这些不重要的子项。



实现
    public function get numAutomationChildren():int
    

processedDescriptors

属性 
processedDescriptors:Boolean

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

临时或延迟子项创建操作后设置为 true,具体取决于发生对象。对于 Container 对象,在 createComponentsFromDescriptors() 方法结束(即 Container 对象使用其子项描述符创建子项)后,该属性设置为 true

例如,如果 Accordion 容器使用延迟的实例化,则在用户导航到 Accordion 容器的第二个窗格并且该窗格创建其子项后,此窗格的 processedDescriptors 属性才变为 true。但是,如果 Accordion 已将 creationPolicy 属性设置为 "all",则在应用程序启动期间此容器第二个窗格的 processedDescriptors 属性设置为 true

非容器类都没有描述符,所以对于这些类,createChildren() 方法创建任何内部组件子项后,该属性设置为 true



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

showInAutomationHierarchy

属性 
showInAutomationHierarchy:Boolean

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

用于确定自动化对象是否显示在自动化层次中的标志。层次中不可见的容器的子项显示为下一个最高可见父项的子项。通常,用于布局的容器(如框和画布)不显示在层次中。

如果合适,某些控件强制其子项在层次中显示。例如,List 控件将始终强制项呈示器(包括框)显示在层次中。实现程序必须支持将此属性设置为 true



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

showRoot

属性 
showRoot:Boolean

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

指定是否显示数据提供程序的根节点的布尔值标志。

如果数据提供程序具有根节点,但 showRoot 属性设置为 false,则 FlexNativeMenu 控件显示的顶级菜单项与根节点的直接子节点对应。

在使用没有根节点的数据提供程序(如 List 或 Array)时,此标志不起任何作用。

默认值为 true。



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

相关 API 元素

    

updateCompletePendingFlag

属性 
updateCompletePendingFlag:Boolean

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

一个标志,确定某个对象是否已通过所有三个阶段的布局验证(假设需要通过所有验证)。



实现
    public function get updateCompletePendingFlag():Boolean
    public function set updateCompletePendingFlag(value:Boolean):void
构造函数详细信息
    

FlexNativeMenu

()构造函数
public function FlexNativeMenu()

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

构造函数。

方法详细信息

    commitProperties

()方法
protected function commitProperties():void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

处理对组件设置的属性。

相关 API 元素

    createAutomationIDPart

()方法 
public function createAutomationIDPart(child:IAutomationObject):Object

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

返回标识此容器中的子项的一组属性。在应用程序的生命期内,不应更改这些值。

参数

child:IAutomationObject — 为其提供 ID 的子项。

返回
Object — 描述稍后可用于解析组件的子项的几组属性。

    createAutomationIDPartWithRequiredProperties

()方法 
public function createAutomationIDPartWithRequiredProperties(child:IAutomationObject, properties:Array):Object

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

返回标识此容器中的子项的一组属性。在应用程序的生命期内,不应更改这些值。

参数

child:IAutomationObject — 为其提供 ID 的子项。
 
properties:Array

返回
Object — 描述稍后可用于解析组件的子项的几组属性。

    display

()方法 
public function display(stage:Stage, x:int, y:int):void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

在指定位置弹出此菜单。

参数

stage:Stage — 要显示此菜单的 Stage 对象。
 
x:int — 相对于要显示此菜单的舞台原点的水平像素数。
 
y:int — 相对于要显示此菜单的舞台原点的垂直像素数。

    getAutomationChildAt

()方法 
public function getAutomationChildAt(index:int):IAutomationObject

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

在指定的索引位置提供自动化对象。该列表不应包含任何复合子项。

参数

index:int — 要返回的子项的索引

返回
IAutomationObject — 位于指定索引位置处的子项。

    getAutomationChildren

()方法 
public function getAutomationChildren():Array

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

提供自动化对象列表。该列表不应包含任何复合子项。

返回
Array — 子代。

    invalidateProperties

()方法 
public function invalidateProperties():void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

标记组件,以便在稍后屏幕更新期间调用该组件的 commitProperties() 方法。

Invalidation 是一个很有用的机制,可将组件更改延迟到稍后屏幕更新时进行处理,从而消除了重复的工作。例如,要更改文本颜色和大小,如果在更改颜色后立即进行更新,然后在设置大小后再更新大小,就有些浪费。同时更改两个属性后再使用新的大小和颜色一次性呈示文本,效率会更高。

很少调用 Invalidation 方法。通常,在组件上设置属性会自动调用合适的 invalidation 方法。

    itemToKeyEquivalent

()方法 
protected function itemToKeyEquivalent(data:Object):String

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

基于 keyEquivalentFieldkeyEquivalentFunction 属性返回给定数据对象的等效键。如果该方法无法将参数转换为字符串,则会返回一个空字符串。

参数

data:Object — 要显示的对象。

返回
String — 基于数据的等效键。

    itemToKeyEquivalentModifiers

()方法 
protected function itemToKeyEquivalentModifiers(data:Object):Array

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

基于 keyEquivalentModifiersFunction 属性,返回给定数据对象的等效功能键。如果这种方法无法将此参数转换为功能键 Array,则返回一个空 Array。

参数

data:Object — 要显示的对象。

返回
Array — 基于数据的等效功能键数组.

    itemToLabel

()方法 
protected function itemToLabel(data:Object):String

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

基于 labelFieldlabelFunction 属性返回用作给定数据对象的菜单项标签的字符串。如果该方法无法将参数转换为字符串,则会返回一个空格。

参数

data:Object — 要显示的对象。

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

    itemToMnemonicIndex

()方法 
protected function itemToMnemonicIndex(data:Object):int

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

基于 mnemonicIndexFieldmnemonicIndexFunction 属性返回给定数据对象的助记键索引。如果这种方法无法将此参数转换为整数,则返回 -1。

参数

data:Object — 要显示的对象。

返回
int — 基于数据的助记键索引。

    parseLabelToMnemonicIndex

()方法 
protected function parseLabelToMnemonicIndex(data:String):int

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

根据是否存在下划线字符从标签中提取助记键索引。如果存在前导下划线字符,则查找该字符并将其用作索引。

参数

data:String — 要对其进行分析以提取索引的数据。

返回
int — 索引。

    parseLabelToString

()方法 
protected function parseLabelToString(data:String):String

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

确定用于 NativeMenuItem 的实际标签,方法为删除下划线字符,然后转换转义下划线字符(如果存在)。

参数

data:String — 要对其进行分析以提取标签的数据。

返回
String — 标签。

    replayAutomatableEvent

()方法 
public function replayAutomatableEvent(event:Event):Boolean

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

重放指定的事件。如果已在 superclass 中定义默认重放行为,组件作者可能应调用 super.replayAutomatableEvent。

参数

event:Event — 要重放的事件。

返回
Boolean — 如果重放成功,则为 true

    resolveAutomationIDPart

()方法 
public function resolveAutomationIDPart(criteria:Object):Array

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

使用提供的 ID 解析子项。ID 是 createAutomationIDPart() 方法提供的一组属性。

参数

criteria:Object — 描述子项的几组属性。条件可以包含能导致多个子项匹配的常规表达式值。

返回
Array — 符合条件的子项的数组;如果可以解析所有子项,则为 null

    setContextMenu

()方法 
public function setContextMenu(component:InteractiveObject):void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

将 InteractiveObject 的上下文菜单设置为基础本机菜单。

参数

component:InteractiveObject — 交互式对象。

    unsetContextMenu

()方法 
public function unsetContextMenu(component:InteractiveObject):void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

取消对已设为基础本机菜单的 InteractiveObject 上下文菜单的设置。

参数

component:InteractiveObject — 交互式对象。

    validateDisplayList

()方法 
public function validateDisplayList():void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

验证子项的位置和大小,并绘制其他可视内容。如果使用此 ILayoutManagerClient 调用 LayoutManager.invalidateDisplayList() 方法,则当更新显示列表时会调用 validateDisplayList() 方法。

    validateNow

()方法 
public function validateNow():void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

验证并更新此对象的属性和布局,并重绘该对象(如果需要)。

    validateProperties

()方法 
public function validateProperties():void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

验证组件的属性。如果使用此 ILayoutManagerClient 调用 LayoutManager.invalidateProperties() 方法,则当提交属性值时会调用 validateProperties() 方法。

    validateSize

()方法 
public function validateSize(recursive:Boolean = false):void

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

如果使用此 ILayoutManagerClient 调用 LayoutManager.invalidateSize() 方法,随后在测量时调用了 validateSize() 方法,则验证组件的度量大小。

参数

recursive:Boolean (default = false) — 如果为 true,则调用对象子项的此方法。

事件详细信息
    

itemClick

事件
事件对象类型: mx.events.FlexNativeMenuEvent
属性 FlexNativeMenuEvent.type = mx.events.FlexNativeMenuEvent.ITEM_CLICK

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

选择菜单项时调度。

FlexNativeMenuEvent.ITEM_CLICK 事件类型常量指示用户已选择菜单项。

此事件类型的事件对象属性包含以下值。并非所有属性对于各种事件都有意义。有关详细信息,请参阅详细的属性说明。

属性
bubblesfalse
cancelabletrue
currentTarget用于定义处理该事件的事件侦听器的对象。例如,如果您使用 myButton.addEventListener() 注册某个事件侦听器,则 myButton 为 currentTarget 的值。
index选定菜单项在菜单中的索引。
itemdataProvider 中选定的项目。
label选定菜单项的标签文本。
nativeMenu与此事件关联的特定 NativeMenu 实例。
nativeMenuItem与此事件关联的特定 NativeMenuItem 实例。
target调度该事件的 Object;它不一定是侦听该事件的 Object。使用 currentTarget 属性始终可以访问侦听事件的 Object。
typeFlexNativeMenuEvent.ITEM_CLICK
    

menuShow

事件  
事件对象类型: mx.events.FlexNativeMenuEvent
属性 FlexNativeMenuEvent.type = mx.events.FlexNativeMenuEvent.MENU_SHOW

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: AIR 1.1

显示菜单或子菜单前调度。

FlexNativeMenuEvent.MENU_SHOW 类型常量指示鼠标指针已滑过菜单或子菜单已打开。

此事件类型的事件对象属性包含以下值。并非所有属性对于各种事件都有意义。有关详细信息,请参阅详细的属性说明。

属性
bubblesfalse
cancelabletrue
currentTarget用于定义处理该事件的事件侦听器的对象。例如,如果您使用 myButton.addEventListener() 注册某个事件侦听器,则 myButton 为 currentTarget 的值。
index-1。对于这种类型的事件未设置此属性。
itemnull。对于这种类型的事件未设置此属性。
labelnull。对于这种类型的事件未设置此属性。
nativeMenu与此事件关联的特定 NativeMenu 实例。
nativeMenuItemnull。对于这种类型的事件未设置此属性。
target调度该事件的 Object;它不一定是侦听该事件的 Object。使用 currentTarget 属性始终可以访问侦听事件的 Object。
typeFlexNativeMenuEvent.MENU_SHOW




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

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