Adobe air create transparent window




















When you create a window, you set these properties on the NativeWindowInitOptions object passed to the window constructor. AIR reads the properties for the initial application window from the application descriptor. Except the type property, which cannot be set in the application descriptor and is always set to normal. The properties cannot be changed after window creation. Some settings of these properties are mutually incompatible: systemChrome cannot be set to standard when either transparent is true or type is lightweight.

The AIR window types combine chrome and visibility attributes of the native operating system to create three functional types of window. Use the constants defined in the NativeWindowType class to reference the type names in code. AIR provides the following window types:.

A typical window. Normal windows use the full-size style of chrome and appear on the Windows taskbar and the Mac OS X window menu. A tool palette. Utility windows use a slimmer version of the system chrome and do not appear on the Windows taskbar and the Mac OS X window menu. Lightweight windows have no chrome and do not appear on the Windows taskbar or the Mac OS X window menu. Lightweight windows are suitable for notification bubbles and controls such as combo-boxes that open a short-lived display area.

When the lightweight type is used, systemChrome must be set to none. Window chrome is the set of controls that allow users to manipulate a window in the desktop environment. Chrome elements include the title bar, title bar buttons, border, and resize grippers. You can set the systemChrome property to standard or none. Choose none to provide your own chrome for the window. Use the constants defined in the NativeWindowSystemChrome class to reference the system chrome settings in code. System chrome is managed by the system.

Your application has no direct access to the controls themselves, but can react to the events dispatched when the controls are used. When you use standard chrome for a window, the transparent property must be set to false and the type property must be normal or utility. When you create a window with no system chrome, then you must add your own chrome controls to handle the interactions between a user and the window.

You are also free to make transparent, non-rectangular windows. To allow alpha blending of a window with the desktop or other windows, set the window transparent property to true.

The transparent property must be set before the window is created and cannot be changed. A transparent window has no default background. Any window area not containing an object drawn by the application is invisible. Ignored settings. Set the basic application properties in the application descriptor file. This section covers the properties relevant to desktop AIR applications. The elements of the application descriptor file are fully described in AIR application descriptor files.

Specify the version of the AIR runtime required by your application using the namespace of the application descriptor file. The namespace, assigned in the application element, determines, in large part, which features your application can use. For example, if your application uses the AIR 1. Only when you change the namespace and publish an update will your application have access to the new behavior and features.

Security and WebKit changes are the primary exceptions to this policy. Specify the namespace using the xmlns attribute of the root application element:. Several settings should be unique for each application that you publish.

The unique settings include the ID, the name, and the filename. You can use any string. In AIR 2. The version element can no longer be used. Each segment of the version number can have up to three digits. You can also specify a label for the version using the versionLabel element.

When you add a version label, it is displayed instead of the version number in such places as the AIR application installer dialogs. AIR uses the child elements of the initialWindow element control the initial appearance and behavior of this initial application window. A move event is dispatched if the top, left corner of the window moved because of the maximize operation. A resize event is dispatched if the window size changed because of the maximize operation.

A NativeWindow object dispatches a similar sequence of events when minimizing, restoring, closing, moving, and resizing a window. The warning events are only dispatched when a change is initiated through window chrome or other operating-system controlled mechanism. When you call a window method to change the window size, position, or display state, the window only dispatches an event to announce the change.

You can dispatch a warning event, if desired, using the window dispatchEvent method, then check to see if your warning event has been canceled before proceeding with the change. For detailed information about the window API classes, methods, properties, and events, see the ActionScript 3. When you create a window, you set these properties on the NativeWindowInitOptions object passed to the window constructor. AIR reads the properties for the initial application window from the application descriptor.

Except the type property, which cannot be set in the application descriptor and is always set to normal. The properties cannot be changed after window creation.

Some settings of these properties are mutually incompatible: systemChrome cannot be set to standard when either transparent is true or type is lightweight. The AIR window types combine chrome and visibility attributes of the native operating system to create three functional types of window. Use the constants defined in the NativeWindowType class to reference the type names in code. AIR provides the following window types:.

A typical window. Normal windows use the full-size style of chrome and appear on the Windows taskbar and the Mac OS X window menu. A tool palette. Utility windows use a slimmer version of the system chrome and do not appear on the Windows taskbar and the Mac OS X window menu. Lightweight windows have no chrome and do not appear on the Windows taskbar or the Mac OS X window menu.

Lightweight windows are suitable for notification bubbles and controls such as combo-boxes that open a short-lived display area. When the lightweight type is used, systemChrome must be set to none.

Window chrome is the set of controls that allow users to manipulate a window in the desktop environment. Chrome elements include the title bar, title bar buttons, border, and resize grippers. You can set the systemChrome property to standard or none. Choose none to provide your own chrome for the window. Use the constants defined in the NativeWindowSystemChrome class to reference the system chrome settings in code. System chrome is managed by the system.

Your application has no direct access to the controls themselves, but can react to the events dispatched when the controls are used. When you use standard chrome for a window, the transparent property must be set to false and the type property must be normal or utility.

When you use the Flex WindowedApplication or Window components, the window can be use either system chrome or chrome provided by the Flex framework. To use the Flex chrome, set the systemChrome property used to create the window to none. When using the Flex 4 spark components rather than the mx components, you must specify the skin class in order to use Flex chrome. You can use the built-in skins or provide your own. The following example demonstrates how to use the built-in spark WindowedApplication skin class to provide the window chrome:.

When you create a window with no system chrome, then you must add your own chrome controls to handle the interactions between a user and the window. Applying Filter in actionscript 3. Share this: Twitter Facebook. Like this: Like Loading Leo said. Leave a Reply Cancel reply Enter your comment here Fill in your details below or click an icon to log in:. Email required Address never made public. Name required. Blog at WordPress. Follow Following.



0コメント

  • 1000 / 1000