将
此字符串由对象的类名称和应用程序内的唯一整数连接而成,如
如果组件中的子组件实现了 IFocusManagerComponent 接口,但是您从不希望它获得焦点,作为一种优化,您可以先将
这将使 FocusManager 忽略此组件,并且使它不会对组件进行监视以查看
注意:这并不意味着您无法在
这与 Flash Player 使用的
对于处理键盘输入的组件该标志通常为
<mx:Window>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<mx:Window Properties alwaysInFront="false" height="100" maxHeight="2880 less the height of the system chrome" maximizable="true" maxWidth="2880 less the width of the system chrome" menu="null" minHeight="dependent on the operating system and the AIR systemChrome setting" minimizable="true" minWidth="dependent on the operating system and the AIR systemChrome setting" resizable="true" showGripper="true" showStatusBar="true" showTitleBar="true" status="" statusBarFactory="mx.core.ClassFactory" systemChrome="standard" title="" titleBarFactory="mx.core.ClassFactory" titleIcon="null" transparent="false" type="normal" visible="true" width="100" Styles buttonAlignment="auto" buttonPadding="2" closeButtonSkin="mx.skins.halo.windowCloseButtonSkin" gripperPadding="3" gripperStyleName="gripperStyle" headerHeight="undefined" maximizeButtonSkin="mx.skins.halo.WindowMaximizeButtonSkin" minimizeButtonSkin="mx.skins.halo.WindowMinimizeButtonSkin" restoreButtonSkin="mx.skins.halo.WindowRestoreButtonSkin" showFlexChrome="true" statusBarBackgroundColor="0xC0C0C0" statusBarBackgroundSkin="mx.skins.halo.StatusBarBackgroundSkin" statusTextStyleName="undefined" titleAlignment="auto" titleBarBackgroundSkin="mx.skins.halo.ApplicationTitleBarBackgroundSkin" titleBarButtonPadding="5" titleBarColors="[ 0x000000, 0x000000 ]" titleTextStyleName="undefined" Effects closeEffect="No default" minimizeEffect="No default" unminimizeEffect="No default" Events applicationActivate="No default" applicationDeactivate="No default" closing="No default" displayStateChange="No default" displayStateChanging="No default" moving="No default" networkChange="No default" resizing="No default" windowComplete="No default" windowMove="No default" windowResize="No default" />]]>
Window 容器无法在其他布局容器中使用,在这个意义上来说,它是一种特殊容器。mx:Window 组件必须是其 MXML 文档中的顶级组件。
使用 Window 组件定义本机窗口的最简便方法是创建一个 MXML 文档,并在该文档中使用
在应用程序代码中,要在屏幕上显示 Window 子类的实例,请首先在代码中创建类的实例(通过定义变量并调用
请注意,Window 类的部分属性仅可以在调用
在 Mac OS X 上,其
如果编写一个自定义状态栏类,则它应该公开名为
打开窗口后,此属性将立即变为只读模式。
默认值为
如果编写一个自定义标题栏类,则它应该公开名为
此属性在窗口打开后是只读的。
打开窗口后,此属性将立即变为只读模式。
默认值为
<mx:WindowedApplication>
tag inherits all of the tag
attributes of its superclass and adds the following tag attributes:
<mx:WindowedApplication Properties alwaysInFront="false" autoExit="true" backgroundFrameRate="-1" dockIconMenu="null" maxHeight="2880 less the height of the system chrome" maxWidth="2880 less the width of the system chrome" menu="null" minHeight="dependent on the operating system and the AIR systemChrome setting" minWidth="dependent on the operating system and the AIR systemChrome setting" showGripper="true" showStatusBar="true" showTitleBar="true" status="" statusBarFactory="mx.core.ClassFactory" systemTrayIconMenu="null" title="" titleBarFactory="mx.core.ClassFactory" titleIcon="null" useNativeDragManager="true" Styles buttonAlignment="auto" buttonPadding="2" closeButtonSkin="mx.skins.halo.windowCloseButtonSkin" gripperPadding="3" gripperStyleName="gripperStyle" headerHeight="undefined" maximizeButtonSkin="mx.skins.halo.WindowMaximizeButtonSkin" minimizeButtonSkin="mx.skins.halo.WindowMinimizeButtonSkin" restoreButtonSkin="mx.skins.halo.WindowRestoreButtonSkin" showFlexChrome="true" statusBarBackgroundColor="0xC0C0C0" statusBarBackgroundSkin="mx.skins.halo.StatusBarBackgroundSkin" statusTextStyleName="undefined" titleAlignment="auto" titleBarBackgroundSkin="mx.skins.halo.ApplicationTitleBarBackgroundSkin" titleBarButtonPadding="5" titleBarColors="[ 0x000000, 0x000000 ]" titleTextStyleName="undefined" Effects closeEffect="No default" minimizeEffect="No default" unminimizeEffect="No default" Events applicationActivate="No default" applicationDeactivate="No default" closing="No default" displayStateChange="No default" displayStateChanging="No default" invoke="No default" moving="No default" networkChange="No default" resizing="No default" windowComplete="No default" windowMove="No default" windowResize="No default" />]]>
WindowedApplication 有两个作用。它可以替换 <mx:Application> 标签,与基于 Flex 的 AIR 应用程序的入口点具有相同的作用。此外,作为容器,WindowedApplication 可定义 Flex AIR 应用程序初始窗口的布局,在 WindowedApplication 中定义的任何可见控件都将成为 AIR 应用程序加载的初始窗口中的内容。
WindowedApplication 是基于 Flex 的 AIR 应用程序的顶层应用程序。该应用程序没有设计为由其它 Flex 应用程序进行加载。如果 WindowedApplication 需要加载其它应用程序,请使用 Application 类作为这些应用程序的容器。如果需要其它窗口,请使用 Window 类作为这些窗口的容器。
请注意,由于 WindowedApplication 只呈示单个窗口中的可见内容,而不是多窗口应用程序中的所有窗口,所以 WindowedApplication 实例只为自己的舞台和窗口分派与显示相关的事件(WindowedApplication 类从显示对象的 InteractiveObject 和 UIComponent 等基类继承的事件),而不为应用程序中其它窗口发生的事件分派这些事件。这与基于浏览器的应用程序不同。在后者中,Application 容器会为应用程序中的所有窗口分派这些事件(因为从技术角度而言,这些窗口都是在单个 Application 舞台上呈示的显示对象)。
注意:无法使用 ActionScript 代码设置此属性;必须使用 MXML 代码进行设置。这意味着无法在运行时更改此属性的值。
默认情况下,Flex 中内置的 AIR 应用程序的 DragManager 使用 NativeDragManagerImpl 类作为实现类。Flex 中内置的 Flash Player 应用程序使用 DragManagerImpl 类。
NativeDragManagerImpl 类是 AIR NativeDragManager API 和 Flex DragManager API 之间的桥梁。AIR NativeDragManager 类使用操作系统的拖放 API。该类支持在 AIR 窗口之间以及在操作系统和 AIR 之间进行拖动。由于操作系统控制拖放操作,因此在拖动过程中无法自定义光标,您也无法控制释放动画。该行为取决于操作系统,在不同平台间会存在某些不一致。
DragManagerImpl 类不使用操作系统进行拖放操作,而是由自身控制整个拖放过程。该类支持自定义光标,并提供释放动画。但是,它不允许在 AIR 窗口之间以及在操作系统和 AIR 窗口之间进行拖动。
在 Mac OS X 上,其
如果编写一个自定义状态栏类,则它应该公开名为
如果编写一个自定义标题栏类,则它应该公开名为