13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Working with AIR native windows<br />

System chrome is managed by the system. Your application has no direct access to the controls themselves, but can<br />

react to the ev<strong>en</strong>ts dispatched wh<strong>en</strong> the controls are used. Wh<strong>en</strong> you use standard chrome for a window, the<br />

transpar<strong>en</strong>t property must be set to false and the type property must be normal or utility.<br />

Flex chrome<br />

Wh<strong>en</strong> you use the Flex WindowedApplication or Window compon<strong>en</strong>ts, the window can be use either system chrome<br />

or chrome provided by the Flex framework. To use the Flex chrome, set the systemChrome property used to create the<br />

window to none. Wh<strong>en</strong> using the Flex 4 spark compon<strong>en</strong>ts rather than the mx compon<strong>en</strong>ts, you must specify the skin<br />

class in order to use Flex chrome. You can use the built-in skins or provide your own. The following example<br />

demonstrates how to use the built-in spark WindowedApplication skin class to provide the window chrome:<br />

<br />

<br />

<br />

@namespace "library://ns.adobe.com/flex/spark";<br />

WindowedApplication<br />

{<br />

skinClass:ClassRefer<strong>en</strong>ce("spark.skins.spark.SparkChromeWindowedApplicationSkin");<br />

}<br />

<br />

<br />

For more information, see Using Flex 4: About the AIR window containers: Controlling window chrome<br />

Custom chrome<br />

Wh<strong>en</strong> you create a window with no system chrome, th<strong>en</strong> you must add your own chrome controls to handle the<br />

interactions betwe<strong>en</strong> a user and the window. You are also free to make transpar<strong>en</strong>t, non-rectangular windows.<br />

To use custom chrome with the mx:WindowedApplication or mx:Window compon<strong>en</strong>ts, you must set the<br />

showFlexChrome style to false. Otherwise, Flex will add its own chrome to your windows.<br />

Window transpar<strong>en</strong>cy<br />

Adobe AIR 1.0 and later<br />

To allow alpha bl<strong>en</strong>ding of a window with the desktop or other windows, set the window transpar<strong>en</strong>t property to<br />

true. The transpar<strong>en</strong>t property must be set before the window is created and cannot be changed.<br />

A transpar<strong>en</strong>t window has no default background. Any window area not containing an object drawn by the application<br />

is invisible. If a displayed object has an alpha setting of less than one, th<strong>en</strong> anything below the object shows through,<br />

including other display objects in the same window, other windows, and the desktop.<br />

Transpar<strong>en</strong>t windows are useful wh<strong>en</strong> you want to create applications with borders that are irregular in shape or that<br />

“fade out” or appear to be invisible. However, r<strong>en</strong>dering large alpha-bl<strong>en</strong>ded areas can be slow, so the effect should be<br />

used conservatively.<br />

Important: On Linux, mouse ev<strong>en</strong>ts do not pass through fully transpar<strong>en</strong>t pixels. You should avoid creating windows<br />

with large, fully transpar<strong>en</strong>t areas since you may invisibly block the user’s access to other windows or items on their<br />

desktop. On Mac OS X and Windows, mouse ev<strong>en</strong>ts do pass through fully transpar<strong>en</strong>t pixels.<br />

Transpar<strong>en</strong>cy cannot be used with windows that have system chrome. In addition, SWF and PDF cont<strong>en</strong>t in HTML<br />

may not display in transpar<strong>en</strong>t windows. For more information, see “Considerations wh<strong>en</strong> loading SWF or PDF<br />

cont<strong>en</strong>t in an HTML page” on page 1001.<br />

Last updated 6/6/2012<br />

893

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!