You cannot instantiate the InteractiveObject class directly. A call to the
The InteractiveObject class itself does not include any APIs for rendering content onscreen. To create a custom subclass of the InteractiveObject class, extend one of the subclasses that do have APIs for rendering content onscreen, such as the Sprite, SimpleButton, TextField, or MovieClip classes.
The event's dropAction property indicates the action set
by the drag target object; a value of "none" (
The
Access the dropped data using the event object
The handler for this event should set the
Handle either the
To determine whether the dispatching display object can accept the drop,
check the suitability of the data in
Handle either the
To determine whether the dispatching display object can accept the drop,
check the suitability of the data in
In AIR, canceling this event prevents the character from being entered into a text field.
Specifically, if a user moves a finger over an InteractiveObject, and then moves the fingers together, the InteractiveObject instance can
dispatch a
When handling the properties of the event object, note that the
Note: While some devices using the Mac OS operating system can interpret a four-finger swipe, this API only supports a three-finger swipe.
Specifically, if a user moves a finger over an InteractiveObject, and then moves the fingers apart, the InteractiveObject instance can
dispatch a
When handling the properties of the event object, note that the
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user moves a finger over an InteractiveObject, the InteractiveObject instance can
dispatch a
When handling the properties of the event object, note that the
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user moves a finger over an InteractiveObject, and then provides a secondary tap, the InteractiveObject instance can
dispatch a
When handling the properties of the event object, note that the
Specifically, if a user moves a finger over an InteractiveObject, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user taps two fingers over an InteractiveObject, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user taps a finger over an InteractiveObject, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user moves a finger over an InteractiveObject, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user moves a finger over an InteractiveObject, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user moves a finger over an InteractiveObject, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user moves a finger across a touch screen, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user moves a finger across a touch screen, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user lifts a finger from a touch screen, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
Specifically, if a user touches a finger to a touch screen, the InteractiveObject instance can dispatch a
Note: See the Multitouch class for environment compatibility information.
The purpose of the
The purpose of the
The
The
The
The double-click text selection behavior of a TextField object
is not related to the
This event is dispatched to the object that currently has focus. The related object for this event is the
InteractiveObject instance that receives focus if you do not prevent the default behavior. You can prevent the change in
focus by calling
This event is dispatched to the object that currently has focus.
The related object for this event is the InteractiveObject instance that receives focus
if you do not prevent the default behavior.
You can prevent the change in focus by calling the
Calling this method focuses the InteractiveObject instance and raises the soft keyboard, if necessary.
The
Note: This method is not supported in AIR applications on iOS.
For content running in Flash Player, this property is a ContextMenu object. In the AIR runtime, the ContextMenu class extends the NativeMenu class, however Flash Player only supports the ContextMenu class, not the NativeMenu class.
Note: TextField objects always include a clipboard menu in the context menu. The clipboard menu contains
Cut, Copy, Paste, Clear, and Select All commands. You cannot remove these commands from the context menu for TextField objects.
For TextField objects, selecting these commands (or their keyboard equivalents) does not generate
No event is dispatched by setting this property. You must use the
No event is dispatched by setting this property. You must use the
By default, the value is
The InteractiveObject instance dispatches
Note: This property is not supported in AIR applications on iOS.
If the
Specify the
Note: On Android, the
If any currently displayed object in the SWF file contains a
The
The custom tab ordering that the
Note: To set the tab order for TLFTextField instances, cast the display object child
of the TLFTextField as an InteractiveObject, then set the
InteractiveObject(tlfInstance.getChildAt(1)).tabIndex = 3;To reverse the tab order from the default setting for three instances of a TLFTextField object (
InteractiveObject(tlfInstance1.getChildAt(1)).tabIndex = 3; InteractiveObject(tlfInstance2.getChildAt(1)).tabIndex = 2; InteractiveObject(tlfInstance3.getChildAt(1)).tabIndex = 1;
The triangle vertices do not contain z coordinates and do not necessarily represent 3D faces. However a triangle path can be used to support the rendering of 3D geometry in a 2D space.
In UV coordinates, (0,0) is the upper left of the bitmap, and (1,1) is the lower right of the bitmap.
If the length of this vector is twice the length of the
If the length of this vector is three times the length of the
Can be set to any value defined by the TriangleCulling class.
The DisplayObject class supports basic functionality like the x and y position of an object, as well as more advanced properties of the object such as its transformation matrix.
DisplayObject is an abstract base class; therefore, you cannot call DisplayObject directly. Invoking
All display objects inherit from the DisplayObject class.
The DisplayObject class itself does not include any APIs for rendering content onscreen. For that reason, if you want create a custom subclass of the DisplayObject class, you will want to extend one of its subclasses that do have APIs for rendering content onscreen, such as the Shape, Sprite, Bitmap, SimpleButton, TextField, or MovieClip class.
The DisplayObject class contains several broadcast events. Normally, the target
of any particular event is a specific DisplayObject instance. For example,
the target of an
Some properties previously used in the ActionScript 1.0 and 2.0 MovieClip, TextField, and Button
classes (such as
For more information, see the "Display Programming" chapter of the ActionScript 3.0 Developer's Guide.
Note: This event is not dispatched if the display is not rendering. This is the case when the content is either minimized or obscured.
The following methods of a DisplayObjectContainer object also generate this event if an object must be removed
to make room for the new object:
The following methods of a DisplayObjectContainer object also generate this event if an object must be removed
to make room for the new object:
Note: Use the
The
Note: Use
To use this method, first create an instance of the Point class.
The x and y values that you assign to the Point object represent global
coordinates because they are relative to the origin (0,0) of the main display area.
Then pass the Point object to the
To use this method, first create an instance of the Point class. The
x and y values that you assign represent global coordinates because they
relate to the origin (0,0) of the main display area. Then pass the Point instance
as the parameter to the
For example, you can only use two-dimensional coordinates (x,y) to
draw with the
This method allows you to convert any given x and y coordinates from values that are relative to the origin (0,0) of a specific display object (local coordinates) to values that are relative to the origin of the Stage (global coordinates).
To use this method, first create an instance of the Point class. The x and y values that you assign represent local coordinates because they relate to the origin of the display object.
You then pass the Point instance that you created as the parameter to
the
Note: For an object created in the Flash authoring environment, the value of
The
The following table describes the
For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33). Not supported under GPU rendering.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33).
For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33).
For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00).
AIR profile support: This feature is supported
on mobile devices, but it is not supported on desktop operating systems. It also has
limited support on AIR for TV devices.
Specifically, on AIR for TV devices, supported transformations include scaling and translation,
but not rotation and skewing. See
With
To use the hardware acceleration, set Rendering to GPU in
the General tab of the iPhone Settings dialog box in Flash Professional CS5.
Or set the
For example, the following code sends an untransformed bitmap representation of the display object to the GPU:
Usually, the identity matrix (
Generally, you should choose to use a matrix that transforms the display object to the size that it will appear in the application. For example, if your application displays the bitmap version of the sprite scaled down by a half, use a matrix that scales down by a half. If you application will display the sprite larger than its current dimensions, use a matrix that scales up by that factor.
Note: The
All vector data for a display object that has a cached bitmap is drawn to the bitmap
instead of the main display. If
If
No internal bitmap is created unless the
After you set the
The
A display object does not use a bitmap even if the
The
Filters can be applied in Flash Professional at design time, or at run time by using
ActionScript code. To apply a filter by using ActionScript, you must make a temporary copy of the
entire
To add a filter by using ActionScript, perform the following steps (assume that the
target display object is named
If the
To modify an existing filter object,
you must use the technique of modifying a copy of the
At load time, if a display object has an associated filter, it is marked to cache itself as a transparent bitmap. From this point forward, as long as the display object has a valid filter list, the player caches the display object as a bitmap. This source bitmap is used as a source image for the filter effects. Each display object usually has two bitmaps: one with the original unfiltered source display object and another for the final image after filtering. The final image is used when rendering. As long as the display object does not change, the final image does not need updating.
The flash.filters package includes classes for filters. For example, to create a DropShadow filter, you would write:
You can use the
Note: Since you cannot directly add a new filter object to the
Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a height
of 0, even if you try to set
A large SWF file can monitor its download by calling
To be able to scale a mask object, it must be on the display list. To be able to drag a mask Sprite object
(by calling its
When display objects are cached by setting the
Note: A single
Note: For a DisplayObject that has been rotated, the returned x coordinate will reflect the non-rotated object.
Note: For a DisplayObject that has been rotated, the returned y coordinate will reflect the non-rotated object.
If set to a number value, the surface is opaque (not transparent) with the RGB background
color that the number specifies. If set to
The
The opaque background region is not matched when calling the
The opaque background region does not respond to mouse events.
You can use
For example, if you create a new Sprite object by calling the
For a loaded SWF file, even though the Loader object used to load the file may not be on the display list,
the top-most display object in the SWF file has its
scale9Grid
set for the movie clip, the thickness of the 20-pixel line does not
vary when the clip scales (although the gradient in the movie clip does scale):
When you define the
You can think of the eight regions outside of the center (defined by the rectangle) as being like a picture frame that has special rules applied to it when scaled.
When the
If a display object is rotated, all subsequent scaling is normal (and the
For example, consider the following display object and a rectangle that is applied as the display
object's
The display object.
The red rectangle shows the
When the display object is scaled or stretched, the objects within the rectangle scale
normally, but the objects outside of the rectangle scale according to the
A common use for setting
Scaling the local coordinate system changes the
Scaling the local coordinate system changes the
Scaling the local coordinate system changes the
The properties of the
You can scroll an object left and right by setting the
If a display object is not added to the display list, its
Each of the transform object's properties is itself an object. This concept is important because the only way to set new values for the matrix or colorTransform objects is to create a new object and copy that object into the transform.matrix or transform.colorTransform property.
For example, to increase the
var myMatrix:Matrix = myDisplayObject.transform.matrix; myMatrix.tx += 10; myDisplayObject.transform.matrix = myMatrix;
You cannot directly set the
myDisplayObject.transform.matrix.tx += 10;
You can also copy an entire transform object and assign it to another
display object's transform property. For example, the following code
copies the entire transform object from
The resulting display object,
Note that AIR for TV devices use hardware acceleration, if it is available, for color transforms.
Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a width
of 0, even if you try to set
When you set a
For example, a child of the
Setting the
The Shader assigned to the
When you assign a Shader instance to this property the shader is copied internally. The blend operation uses that internal copy, not a reference to the original shader. Any changes made to the shader, such as changing a parameter value, input, or bytecode, are not applied to the copied shader that's used for the blend mode.
Use the URLLoader class to load text or binary data.
The Loader class overrides the following methods that it inherits, because a Loader object can only
have one child display object—the display object that it loads. Calling the following methods throws an
exception:
Note: The ActionScript 2.0 MovieClipLoader and LoadVars classes are not used in ActionScript 3.0. The Loader and URLLoader classes replace them.
When you use the Loader class, consider the Flash Player and Adobe AIR security model:
However, in AIR, content in the
For more information related to security, see the Flash Player Developer Center Topic:
When loading a SWF file from an untrusted source (such as a domain other than that of the Loader object's root SWF file), you may want to define a mask for the Loader object, to prevent the loaded content (which is a child of the Loader object) from drawing to portions of the Stage outside of that mask, as shown in the following code:
Keep in mind the following requirements:
You can also use a Loader instance "offlist," that is without adding it to a display object container on the display list. In this mode, the Loader instance might be used to load a SWF file that contains additional modules of an application.
To detect when the SWF file is finished loading, you can use the events of the LoaderInfo
object associated with the
To determine the status of a Loader object, monitor the following events that the LoaderInfo
object associated with the
If the
For more information related to security, see the Flash Player Developer Center Topic:
The
When you use this method, consider the Flash Player security model, which is described in the Loader class description.
If the
For more information related to security, see the Flash Player Developer Center Topic:
The
When you use this method, consider the Flash Player security model, which is described in the Loader class description.
MovieClipLoader.loadClip()
method by creating a handler for the onLoadInit
event and then making the request.
You should either place the following code directly into a frame action on a Timeline, or paste it into a class that extends MovieClip. This code also expects an image named YourImage.jpg to exist in the same directory as the compiled SWF file.
If the
For complete details, see the description of the properties in the
Note: In AIR 1.5 and Flash Player 10, the maximum size for a loaded image is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels. (So, if an loaded image is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height and 2,880 pixels in width.
A SWF file or image loaded into a Loader object inherits the position, rotation, and scale properties of the parent display objects of the Loader object.
Use the
You can prevent a SWF file from using this method by setting the
When you use this method, consider the Flash Player security model, which is described in the Loader class description.
In Flash Player 10 and later, if you use a multipart Content-Type (for example "multipart/form-data") that contains an upload (indicated by a "filename" parameter in a "content-disposition" header within the POST body), the POST operation is subject to the security rules applied to uploads:
Also, for any multipart Content-Type, the syntax must be valid (according to the RFC2046 standard). If the syntax appears to be invalid, the POST operation is subject to the security rules applied to uploads.
For more information related to security, see the Flash Player Developer Center Topic:
As a best practice, before you unload a child SWF file, you should explicitly
close any streams in the child SWF file's objects, such as LocalConnection, NetConnection,
NetStream, and Sound objects. Otherwise, audio in the child SWF file might continue to play, even
though the child SWF file was unloaded. To close streams in the child SWF file, add an event listener
to the child that listens for the
function closeAllStreams(evt:Event) { myNetStream.close(); mySound.close(); myNetConnection.close(); myLocalConnection.close(); } myMovieClip.loaderInfo.addEventListener(Event.UNLOAD, closeAllStreams);
Events related to the load are dispatched by the LoaderInfo object referenced by the
To detect uncaught errors that happen in a loaded SWF, use the
Note that a Loader object's
If the content loaded by the Loader object is an AVM1 (ActionScript 2) SWF file,
uncaught errors in the AVM1 SWF file do not result in an
In the constructor, the code creates a Loader object and registers a listener for
the
In the
A menu item can be a command, a submenu, or a separator line:
Listen for
Listen to this event to update the item either before the containing menu is displayed, or when its key
equivalent is pressed by the user. The
The
The
A
Note: If the window containing the menu is in fullscreen mode
(
To create a menu command, set the
To create a submenu command, create a command item and then assign the
NativeMenu object for the submenu to the item's
To create a separator, set the
Add and remove items from a menu using the NativeMenu
You can assign any object to this property. The assigned object is
not used by the menu system, but is available to event handling code
(through the target property of the event object).
By default, the value of this property is
Create a separator line by setting the
Use the constants defined in the Keyboard class to specify the modifier key codes. Valid modifier keys include:
If you do not assign any modifiers, then by default the
If you assign an uppercase letter to the
Set the
By default, a key equivalent modifier (Ctrl on Windows or Linux and
Command on Mac OS X) is included as part of the key equivalent.
If you want the key equivalent to be a key with no modifier,
set the
The character at the specified position is the mnemonic character for the menu item. The index is zero-based, so the first character has an index of 0.
This property is ignored on operating systems that do not use menu mnemonics.
The name value is not displayed and can be used as a locale-independent identifier. A name is not assigned automatically.
Assigning a NativeMenu object to this property changes the appearance and behavior of the menu item. A submenu item displays the submenu icon and no longer dispatches select events.
Note: Adding a menu as a submenu of itself (in a circular reference) can cause an application to hang.
AIR profile support: This feature is supported
on all desktop operating systems, but is not supported on mobile devices or AIR for TV devices. You can test
for support at run time using the
A native menu is a menu that is controlled and drawn by the operating system rather than by your application. AIR supports the following types of native menus:
A menu object contains menu items. A menu item can represent a command, a submenu, or a separator line.
Add menu items to a menu using the
To create a submenu, add a menu item to the parent menu object. Assign the menu object representing
the submenu to the
Note: The root menu of window and application menus must contain only submenu items; items that do not represent submenus may not be displayed and are contrary to user expectation for these types of menus.
Menus dispatch
Menus dispatch
Note: If you are using the Flex Framework, consider using the FlexNativeMenu class. It is typically easier to define menus declaratively in MXML than it is to write ActionScript code to create the menu structure item-by-item.
Listen to this event to update the menu either before it is displayed, or when a key
equivalent is pressed by the user. The
The
Listen to this event to update the menu before it is displayed.
A
The
Note: On Mac OS X, prior to AIR 2.6, menus and menu items dispatched a
A
Note: Adding an item to a menu can cause an application to hang if the item's submenu is set to the menu itself (causing a circular reference).
When creating a context menu, you can add either NativeMenuItem or ContextMenuItem objects. However, it is advisable to use only one type of object in a context menu so that all items in the menu have the same properties.
Note: Adding an item to a menu can cause an application to hang if the item's submenu is set to the menu itself (causing a circular reference).
Calling the
Note: Adding a menu as a submenu of itself (in a circular reference) can cause an application to hang.
Calling the
Note: Adding a menu as a submenu of itself (in a circular reference) can cause an application to hang.
Note: The
The array is sorted in display order.
Note: This property is read-only in AIR 1.0. It became read/write in AIR 1.1.
The
Note: When the orientation of the device is rotated left, the orientation of the stage must be rotated right in order to remain upright.
Note: When the orientation of the device is rotated right, the orientation of the stage must be rotated left in order to remain upright.
DisplayObject is an abstract base class; therefore, you cannot call DisplayObject directly. Invoking
For more information, see the "Display Programming" chapter of the ActionScript 3.0 Developer's Guide.
For example, the following example shows three display objects, labeled a, b, and c, at index positions 0, 2, and 1, respectively:
If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.
If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.
Note: The command
The
The
The
The garbage collector reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist.
The garbage collector reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist.
When you use the
This code results in the following arrangement of objects:
This property is useful when you create a button with an instance of the Sprite class
(instead of using the SimpleButton class). When you use a Sprite instance to create a button,
you can choose to decorate the button by using the
No event is dispatched by setting this property. You must use the
Note: Do not use the
Use a GraphicsGradientFill object with the
Note: This value represents positions in the gradient box, not the
coordinate space of the final gradient which can be wider or thinner than the gradient box.
Specify a value for corresponding to each value in the
For example, for a linear gradient that includes two colors (blue and green) the
following example illustrates the placement of the colors in the gradient based on different values
in the
The values in the array must increase sequentially; for example,
For example, the following shows a simple linear gradient between two colors (with the
For example, the following shows a simple linear gradient between two colors:
This example uses
If you use
If you use
A Sprite object is similar to a movie clip, but does not have a timeline. Sprite is an appropriate base class for objects that do not require timelines. For example, Sprite would be a logical base class for user interface (UI) components that typically do not use the timeline.
The Sprite class is new in ActionScript 3.0. It provides an alternative to the functionality of the MovieClip class, which retains all the functionality of previous ActionScript releases to provide backward compatibility.
Note: Each of the event listener methods declares a local
Three-dimensional display objects follow the pointer and
Three-dimensional display objects follow the pointer and
Although it is better to use the SimpleButton class to create buttons,
you can use the
If you use the
You can change the
Note: You must set to
Note: This property does not affect HTML content in an HTMLControl object (in Adobe AIR).
You can change the
Note: In Flex or Flash Builder, if your sprite has child sprites, you might want to
set the
Use a GraphicsBitmapFill object with the
If
For example, consider the following bitmap (a 20 x 20-pixel checkerboard pattern):
When
When
If
Use a GraphicsStroke object with the
If a value is not supplied, the line does not use pixel hinting.
For example, the following illustrations show the different
For example, the following illustrations show the different
Note: For
For example, consider the following angled lines, each drawn with a
Notice that a given
For example, consider the following angled lines, each drawn with a
Notice that a given
For example, the following illustrations show the different
For example, the following illustrations show the different
Note: For
Drawing a GraphicsEndFill object is the equivalent of calling the
The precision mode selection affects the following shader operations. These operations are faster on an Intel processor with the SSE instruction set:
Fast precision mode is designed for maximum performance but does not work consistently on different platforms and individual CPU configurations. In many cases, this level of precision is sufficient to create graphic effects without visible artifacts.
It is usually faster to use fast precision mode than to use lookup tables.
In full precision mode, the shader computes all math operations to the full width of the IEEE 32-bit floating standard. This mode provides consistent behavior on all platforms. In this mode, some math operations such as trigonometric and exponential functions can be slow.
For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33).
Not supported under GPU rendering.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33).
Not supported under GPU rendering.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33).
Not supported under GPU rendering.
Not supported under GPU rendering.
Not supported under GPU rendering.
For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF > 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33).
Not supported under GPU rendering.
For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background.
Not supported under GPU rendering.
Setting the
Not supported under GPU rendering.
For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00).
You cannot create a Graphics object directly from ActionScript code.
If you call
The Graphics class is final; it cannot be subclassed.
For example, consider the following bitmap (a 20 x 20-pixel checkerboard pattern):
When
When
The application renders the fill whenever three or more points are drawn, or when
the
The application renders the fill whenever three or more points are drawn, or when
the
Note: This value represents positions in the gradient box, not the
coordinate space of the final gradient, which can be wider or thinner than the gradient box.
Specify a value for each value in the
For example, for a linear gradient that includes two colors, blue and green, the
following example illustrates the placement of the colors in the gradient based on different values
in the
The values in the array must increase sequentially; for example,
For example, consider a simple linear gradient between two colors:
This example uses
If you use
If you use
For example, consider a simple linear gradient between two colors (with the
The application renders the fill whenever three or more points are drawn, or when
the
When you pass a Shader instance as an argument the shader is copied internally. The drawing fill operation uses that internal copy, not a reference to the original shader. Any changes made to the shader, such as changing a parameter value, input, or bytecode, are not applied to the copied shader that's used for the fill.
The coordinates received in the shader are based on the matrix that is specified
for the
The application renders the fill whenever three or more points are drawn, or when
the
Shader fills are not supported under GPU rendering; filled areas will be colored cyan.
The curve drawn is a quadratic Bezier curve. Quadratic Bezier curves consist of two anchor points and one control point. The curve interpolates the two anchor points and curves toward the control point.
Draw four curves to produce a circle and fill it green.
Note that due to the nature of the quadratic Bezier equation, this is not a perfect circle.
The best way to draw a circle is to use the Graphics class's
Two curve lines of 1 pixel are drawn and the space in between is filled white. The
Graphics paths can contain other graphics paths. If the
Generally, drawings render faster with
The
The
If the length of this vector is twice the length of the
If the length of this vector is three times the length of the
If the
Any type of fill can be used, but if the fill has a transform matrix that transform matrix is ignored.
A
The bitmap line style is used for subsequent calls to Graphics
methods such as the
You can call the
Call the
Calls to the
For example, for a linear gradient that includes two colors, blue and green, the
following figure illustrates the placement of the colors in the gradient based on different values
in the
The values in the array must increase, sequentially; for example,
The gradient line style is used for subsequent calls to Graphics
methods such as the
You can call the
Call the
Calls to the
The method
The shader line style is used for subsequent calls to Graphics
methods such as the
You can call the
Call the
Calls to the
miterLimit
set to 1:
If a value is not supplied, the line does not use pixel hinting.
For example, the following illustrations show the different
For example, the following illustrations show the different
Note: For
For example, consider the following angled lines, each drawn with a
Notice that a given
You can call the
Note: Calls to the
Note: Flash Lite 4 supports only the first three parameters (
The line thickness is set to 10 pixels, color is gold and opaque, caps at the end of lines
is set to none (since all lines are jointed), and the joint between the lines is set to
Using the
Since
Note: The type value is specified when a window is created and cannot be changed.
Screens are independent desktop areas within a possibly larger "virtual desktop." The origin of the virtual desktop is the top-left corner of the operating-system-designated main screen. Thus, the coordinates for the bounds of an individual display screen may be negative. There may also be areas of the virtual desktop that are not within any of the display screens.
The Screen class includes static class members for accessing the available screen objects and instance members for accessing the properties of an individual screen. Screen information should not be cached since it can be changed by a user at any time.
Note that there is not necessarily a one-to-one correspondance between screens and the physical monitors attached to a computer. For example, two monitors may display the same screen.
You cannot instantiate the Screen class directly. Calls to
the
Note, this class is intended to be used as the root class of an AIR application
with the settings
The screen location is relative to the virtual desktop.
On Linux systems that use certain window managers, this property returns the desktop bounds, not the screen's visible bounds.
Modifying the returned array has no effect on the available screens.
The
Note: The fullscreen modes are set using the Stage object
The
A Bitmap object can share its BitmapData reference among several Bitmap objects, independent of translation or rotation properties. Because you can create multiple Bitmap objects that reference the same BitmapData object, multiple display objects can use the same complex BitmapData object without incurring the memory overhead of a BitmapData object for each display object instance.
A BitmapData object can be drawn to the screen by a Bitmap object in one of two ways: by using the vector renderer as a fill-bitmap shape, or by using a faster pixel-copying routine. The pixel-copying routine is substantially faster than the vector renderer, but the Bitmap object must meet certain conditions to use it:
If you load a Bitmap object from a domain other than that of the Loader object used to
load the image, and there is no URL policy file that permits access to the domain of
the Loader object, then a script in that domain cannot access the Bitmap
object or its properties and methods. For more information, see the Flash Player Developer Center Topic:
Note: The Bitmap class is not a subclass of the InteractiveObject class, so
it cannot dispatch mouse events. However, you can use the
Notes:
These properties are added to the ShaderData object when it is created. The properties' names match the names specified in the shader's source code. The data type of each property varies according to what aspect of the shader the property represents. The properties that represent shader parameters are ShaderParameter instances, the properties that represent input images are ShaderInput instances, and the properties that represent shader metadata are instances of the ActionScript class corresponding to their data type (for example, a String instance for textual metadata and a uint for uint metadata).
For example, consider this shader, which is defined with one input image (
If you create a Shader instance by loading the byte code for this shader, the ShaderData
instance in its
Note that any input image or parameter that is defined in the shader source code
but not used in the shader's
Generally, developer code does not create a ShaderData instance.
A ShaderData instance containing data, parameters, and inputs
for a shader is available as the Shader instance's
Note that this example assumes there's a shader bytecode file named "donothing.pbj" in the same directory as the output directory for the application.
There are two primary reasons for using a shader in stand-alone mode:
The
Before execution a ShaderJob operation, you provide an object into which the
result is written, by setting it as the value of the
To begin a background shader operation,
call the
To execute a shader synchronously (that is, not running in the background), call
the
Calling
In asynchronous mode (when
Only one background ShaderJob operation
executes at a time. Shader operations are held in a queue until they execute.
If you call the
To execute a shader operation in synchronous mode, call
When you call the
While a shader operation is executing, the
If the
To process a ByteArray containing a linear array of data (as opposed to
image data) set the corresponding ShaderInput instance's
System chrome refers to the operating system-specific elements of a window such as a title bar, minimize, maximize, and close buttons.
Note: The type of system chrome used is specified when a window is created and cannot be changed.
Do not use.
Use this setting to emulate the look and feel of the native operating system.
In Flash Professional, you can give a button an instance name in the Property inspector. SimpleButton instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel. After you create an instance of a button in Flash Professional, you can use the methods and properties of the SimpleButton class to manipulate buttons with ActionScript.
In ActionScript 3.0, you use the
The SimpleButton class inherits from the InteractiveObject class.
Note: To prevent mouseClicks on a button, set both the
You can change the
myBtn1_btn
and myBtn2_btn
. Enter the following ActionScript in Frame 1 of the Timeline:
When the mouse is over and clicks myBtn1_btn
, there is no pointing hand. However, you see the pointing hand when the button is over and clicks myBtn2_btn
.
You can change the
The terms
A triangle whose vertices 0, 1, and 2 are arranged in a clockwise order has a positive normal value. That is,
its normal points in a positive z-axis direction, away from the current view point.
When the
A triangle whose vertices are arranged in a counter-clockwise order has a negative normal value. That is,
its normal points in a negative z-axis direction, toward the current view point.
When the
AIR profile support: This feature is supported
on all desktop operating systems, but is not supported on mobile devices or AIR for TV devices. You can test
for support at run time on desktop devices using the
A reference to the NativeWindow instance is returned by the window constructor.
A reference to a NativeWindow instance can also be accessed using the
var window:NativeWindow = displayObject.stage.nativeWindow;
The properties of a NativeWindow instance can only be accessed by application content. If non-application content attempts to access the NativeWindow object, a security error will be thrown.
Content can be added to a window using the
DisplayObjectContainer methods of the Stage object such as
You cannot not add Flex components directly to the display list of a NativeWindow instance. Instead, use the Flex mx:WindowedApplication and mx:Window components to create your windows and add the other Flex components as children of those objects. You can add Flex-based SWF content directly to a NativeWindow window as long as the SWF file is loaded into its own application domain and is application content.
To create a root HTML window for displaying HTML content it is typically
easier to create the window with
The following operations on NativeWindow objects are asynchronous:
If the
NativeWindow objects will not be garbage collected after the window constructor has been called
and before
Do not resize the window or change its display state in the
A
Note: Avoid actions that may open simultaneous operating system dialogs boxes
in the handler functions for both the
Note: Avoid actions that may open simultaneous operating system dialogs boxes
in the handler functions for both the
The settings defined in the
The default window size is determined by the operating system, and windows are created in an invisible state.
To prevent changes to the window from being visible, do not change the
window
Activating a window will:
On Linux,
The NativeWindow object dispatches an
With a reference to a display object on the window stage:
A
When a window is closed, any windows that it owns are also closed. The owned windows
do not dispatch
If display object instances that are currently in the window are not referenced elsewhere they will be garbage collected and destroyed, except on the initial application window created by AIR. To allow display objects on the initial window to be garbage collected, remove them from the window stage.
After being closed, the NativeWindow object is still a valid reference, but accessing most properties and methods will throw an illegal operation error.
Closed windows cannot be reopened. If the window is already closed, no action is taken and no events are dispatched.
Note: to hide a window without closing it, set the window's
With a reference to the NativeWindow instance (
Virtual desktop coordinates are relative to the upper, lefthand corner of the primary monitor.
You cannot change ownership of NativeWindows by adding or removing objects from the returned vector. Window ownership cannot be changed after a window is created.
Calling
The
OS behavior notes:
Calling
The
Any windows owned by this window are hidden when it is minimized. The owned windows do not dispatch
Notes:
When
The
The cues provided for informational notifications are of short duration;
those provided for critical notifications will last until the user activates
this window. Not all Linux window managers support two levels of notification.
For such window managers,
Note: Calling
Does not activate or acquire the focus for the window or the application.
Minimized or hidden (
An owned window can never be moved behind its owner. If this window has an owner, then the owner and its other owned windows are also ordered behind the target. If the target window has an owner, then this window is ordered behind the owner of the target instead.
Some Linux window managers do not allow utility windows to be ordered behind normal windows.
Does not activate or acquire the focus for the window or the application.
Minimized or hidden (
A window can never be moved in front of a window that it owns. If this window has an owner, then the owner and its other owned windows are also ordered in front of the target. If the target window has an owner, then this window is also ordered in front of any other windows that have the same owner as the target.
Some Linux window managers do not allow normal windows to be ordered in front of utility windows.
Does not activate or acquire the focus for this window or the application.
Minimized or hidden (
If
An owned window can never be moved behind its owner. If this window has an owner, then the owner and its other owned windows are also ordered to the bottom of window display list. This window will move behind any other windows owned by the same window. If this window owns other windows, then those windows are also moved to the back, maintaining their current order relative to each other.
Some Linux window managers do not allow utility windows to be ordered behind normal windows.
Does not activate or acquire the focus for this window or the application.
Minimized or hidden (
If
A window can never be moved in front of a window that it owns. If this window owns other windows, then those windows are also moved to the front, maintaining their current order relative to each other. If this window has an owner, then the owner and its other owned windows are also ordered to the front of the window display order. This window is moved in front of other windows that have the same owner.
Some Linux window managers do not allow normal windows to be ordered in front of utility windows.
Calling
If the window is already in the
To detect the completion of the state change, listen for
the
When called from a
When called from other code this method begins a keyboard- or mouse-driven move sequence consistent with the operating system's default sequence.
During a move sequence, a series of events will be dispatched as the window origin moves. For
each incremental move, first a
When called from a
When called from other code this method begins a keyboard- or mouse-driven resizing sequence consistent with the operating system's default sequence.
During the resize sequence, a series of events will be dispatched as the
window dimensions change. For each incremental change, first a
Use the
There are two groups of windows in the system depth order. Windows in the
Changing
The
OS behavior notes:
The dimensions of a window include any system chrome. The dimensions of a window's stage are equal to the
dimensions of the window, minus the size of any system chrome. Changing
the width and height of the window will change the stage's
In a root HTML window, the
A
Setting the
The order in which the individual dimensions are set is not guaranteed. On Linux window managers that do not allow windows to extend off the desktop area, a change to an individual property may be blocked even though the net affect of applying all the property changes would have resulted in a legal window.
If the width or height specified is less than the minimum or greater than the maximum allowed width or height, then the window width or height is set to the closest legal size. The factors that determine the minimum and maximum width and height are the following:
Pixel values are rounded to the nearest integer when the position or dimensions of a window are changed.
Accessing the following properties on a closed window will throw an illegal operation error:
Likewise, calling the following methods on a closed window will also throw an illegal operation error:
Constants for the possible values are defined in the NativeWindowDisplayState class:
The dimensions of a window include any system window chrome that is displayed.
The height of the usable display area inside a window is available from the
Changing the
If the height specified is less than the minimum or greater than the maximum allowed height, then the window height is set to the closest legal size. The factors that determine the minimum and maximum height are the following:
On Linux, setting the
To detect the completion of the height change, listen for
the
Pixel values are rounded to the nearest integer when the height of a window is changed.
The size limit is specified as the coordinates of a Point object.
The point
The
Setting
If the width or height specified is greater than the maximum allowed width or height, then the window width is set to the closest legal size. The factors that determine the minimum and maximum width and height are the following:
Note: On some operating systems, such as Mac OS X, maximizing a window will only enlarge the window to the
The
Note: Some Linux window managers allow windows to be maximized by the user even when the
When a NativeMenu object is assigned to the window
Note: Assigning a menu to a window when
The size limit is specified as the coordinates of a Point object.
The point
Setting
The
Note: The width and height of any displayed system chrome may make it impossible to set a window as small as the specified minimum size.
The
Note: Some Linux window managers allow windows to be minimizable by the user even when the
Window ownership is established when a window is created and cannot be changed.
To create a window that has an owner, set the owning NativeWindow object as the
Note: On Linux, some window managers do not display owned windows in front of the owning window when the owner is in fullscreen mode.
Note: Not all Linux window managers honor the resizable
setting.
The
The stage is the root of the display list for the window. Add visual display objects to a window by adding them to the stage or to another object already in the display list of this stage. The stage dimensions are those of the window client area when the window uses system chrome. The stage dimensions are equal to the dimensions of the window if system chrome is not used.
When
Note: Assigning a menu to a window when
When
Note: Calling
When
Note: The value of this property might change while an application is running, based on user preferences set for the operating system.
The values returned by
The system chrome setting cannot be changed after a window is created.
The size limit is specified as the coordinates of a Point object.
The point
In addition to the operating system size limit, AIR has a maximum
window size limit of 4095 by 4095 pixels (2880 pixels by 2880 pixels
in AIR 1.5 and earlier). And an application can set
a limit using the
The size limit is specified as the coordinates of a Point object.
The point
The title will appear in the system chrome for the window, if displayed, as well as in other system-dependent locations (such as the task bar).
The
Note: Window transparency cannot always be supported. If the user's
operating system configuration is such that transparency is not available, the
window will be created without transparency. Areas that would have been transparent
are composited against black. Use the
The values returned by
The
An invisible window is not displayed on the desktop, but all window properties and methods are valid.
By default,
If this window has an owner, the visible state of that owning window determines
whether this window is displayed. If the owning window is not displayed, then
any owned windows are not displayed, even if their
Note: On Mac OS X, setting
The dimensions reported for a native window include any system window chrome
that is displayed.
The width of the usable display area inside a window is available from the
Changing the
If the width specified is less than the minimum or greater than the maximum allowed width, then the window width is set to the closest legal size. The factors that determine the minimum and maximum width are the following:
On Linux, setting the
To detect the completion of the width change, listen for
the
Pixel values are rounded to the nearest integer when the width of a window is changed.
On systems with more than one monitor,
Changing the
On Linux, setting the
To detect the completion of the position change, listen for
the
Pixel values are rounded to the nearest integer when the x-coordinate of a window is changed.
On systems with more than one monitor,
Changing the
On Linux, setting the
To detect the completion of the position change, listen for
the
Pixel values are rounded to the nearest integer when the y-coordinate of a window is changed.
For SWF content running in the browser (in Flash® Player), the Stage represents the entire area where Flash content is shown. For content running in AIR on desktop operating systems, each NativeWindow object has a corresponding Stage object.
The Stage object is not globally accessible. You need to access it through the
The Stage class has several ancestor classes — DisplayObjectContainer, InteractiveObject, DisplayObject, and EventDispatcher — from which it inherits properties and methods. Many of these properties and methods are either inapplicable to Stage objects, or require security checks when called on a Stage object. The properties and methods that require security checks are documented as part of the Stage class.
In addition, the following inherited properties are inapplicable to Stage objects. If you try to set them, an IllegalOperationError is thrown. These properties may always be read, but since they cannot be set, they will always contain default values.
Some events that you might expect to be a part of the Stage class,
such as
Orientation changes can occur when the user rotates the device, opens a slide-out keyboard,
or when the
Note: If the
Important: orientationChanging events are not dispatched on Android devices.
Note: If the
For example, the following example shows three display objects, labeled a, b, and c, at index positions 0, 2, and 1, respectively:
If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.
If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.
Note: The command
The function can have any name.
Class-level member functions are not subject to garbage
collection, so you can set
After you successfully register an event listener, you cannot change its priority
through additional calls to
Keep in mind that after the listener is registered, subsequent calls to
You cannot register an event listener for only the target phase or the bubbling phase. Those phases are coupled during registration because bubbling applies only to the ancestors of the target node.
If you no longer need an event listener, remove it by calling
Copying an EventDispatcher instance does not copy the event listeners attached to it. (If your newly created node needs an event listener, you must attach the listener after creating the node.) However, if you move an EventDispatcher instance, the event listeners attached to it move along with it.
If the event listener is being registered on a node while an event is being processed on this node, the event listener is not triggered during the current phase but can be triggered during a later phase in the event flow, such as the bubbling phase.
If an event listener is removed from a node while an event is being processed on the node, it is still triggered by the current actions. After it is removed, the event listener is never invoked again (unless registered again for future processing).
The concept of focus direction must be defined by the application (or application framework).
No intrinsic focus sorting of interactive objects exists, although you could use other available
properties to establish an ordering principle. For example, you could sort interactive objects
according to their positions on the Stage or in the display list. Calling
The
If you assign an HTMLLoader object to the
The difference between
When
The
The
The garbage collector reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist.
If the stage orientation changes as a result of the method call, the Stage object dispatches an orientationChange event.
To check whether device orientation is supported, check the value of the
AIR profile support: This feature is supported
on mobile devices, but it is not supported on desktop operating systems or AIR for TV devices. You can test
for support at run time using the
When you use the
This code results in the following arrangement of objects:
Set the
Do not set the parameter to
To check whether changing device orientation is supported, check the value of the
Setting the orientation is an asynchronous operation. It is not guaranteed
to be complete immediately after you call the
Important: The
The difference between the
When
The
trace(Stage.allowsFullsreen);
The initial value of this property is derived from the
AIR profile support: This feature is supported
on mobile devices, but it is not supported on desktop operating systems or AIR for TV devices. You can test
for support at run time using the
The three possible values are strings with corresponding constants in the flash.display.ColorCorrectionSupport class:
Use the
In general, the benefits of activating color management include predictable and consistent color, better conversion, accurate proofing and more efficient cross-media output. Be aware, though, that color management does not provide perfect conversions due to devices having a different gamut from each other or original images. Nor does color management eliminate the need for custom or edited profiles. Color profiles are dependent on browsers, operating systems (OS), OS extensions, output devices, and application support.
Applying color correction degrades the Flash runtime performance.
A Flash runtime's color correction is document style color correction because
all SWF movies are considered documents with implicit sRGB profiles.
Use the
The three possible values are strings with corresponding constants in the flash.display.ColorCorrection class:
On devices with slide-out keyboards, the state of the keyboard has a higher priority in determining the device orientation
than the rotation detected by the accelerometer. Thus on a portrait-aspect device with a side-mounted keyboard,
the
Use the constants defined in the StageOrientation class when setting or comparing values for this property.
AIR profile support: This feature is supported
on mobile devices, but it is not supported on desktop operating systems or AIR for TV devices. You can test
for support at run time using the
The scaling behavior of the movie in full-screen mode is determined by the
The following restrictions apply to SWF files that play within an HTML page (not those using the stand-alone Flash Player or not running in the AIR runtime):
An HTML page may also use a script to generate SWF-embedding tags. You need to alter the script
so that it inserts the proper
A Flash runtime dialog box appears over the movie when users enter full-screen mode to inform the users they are in full-screen mode and that they can press the Escape key to end full-screen mode.
These restrictions are not present for SWF content running in the stand-alone Flash Player or in AIR. AIR supports an interactive full-screen mode which allows keyboard input.
For
On Linux, setting
Note: Fullscreen can only be triggered in certain situations, such as if the user has clicked or pressed a key, due to security restrictions. When run in a browser, the allowFullScreen property must be set to true.
Note: An application might not be able to follow high frame rate settings, either because the target platform is not fast enough or the player is synchronized to the vertical blank timing of the display device (usually 60 Hz on LCD devices). In some cases, a target platform might also choose to lower the maximum frame rate if it anticipates high CPU usage.
For content running in Adobe AIR, setting the
Note: If the user has the opportunity to move the browser from one
monitor to another between retrieving the value and going to full screen
size, the value could be incorrect. If you retrieve the value in an event handler that
sets
This is the pixel height of the monitor and is the same as the
stage height would be if
Note: Test this example in the browser. In the Flash Publish Settings dialog, on the HTML tab, select the template Flash Only - Allow Full Screen. Specify the Flash Player version 9.0.115.0, and make sure the Flash and HTML formats are selected on the Formats tab. Then publish and open the resulting HTML file in the browser.
When this property is set to a valid rectangle and the
This property can only be set when the Flash runtime is not in full-screen mode.
To use this property correctly, set this property first, then set the
To enable scaling, set the
To disable scaling, set the
The end user also can select within Flash Player Display Settings to turn off hardware scaling, which is enabled by default.
For more information, see
Before using the full-screen mode with hardware scaling, the following conditions must be met:
An FLV file is loaded using NetConnection and NetStream objects. Since the FLV file
is in the same directory as the SWF file and will connect via HTTP, the
When the properties and methods of a loaded SWF file are accessible, the
Note: If the user has the opportunity to move the browser from one
monitor to another between retrieving the value and going to full screen
size, the value could be incorrect. If you retrieve the value in an event handler that
sets
This is the pixel width of the monitor and is the same as the stage width would be if
Note: Test this example in the browser. In the Flash Publish Settings dialog, on the HTML tab, select the template Flash Only - Allow Full Screen. Specify the Flash Player version 9.0.115.0, and make sure the Flash and HTML formats are selected on the Formats tab. Then publish and open the resulting HTML file in the browser.
Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a height
of 0, even if you try to set
This property is useful when you create a button with an instance of the Sprite class
(instead of using the SimpleButton class). When you use a Sprite instance to create a button,
you can choose to decorate the button by using the
No event is dispatched by setting this property. You must use the
The window represents the native operating system window; the Stage
represents the content contained by the window. This property is only
valid for content running in AIR on platforms that support the NativeWindow class.
On other platforms, this property will be
To set the stage orientation, use the
Important: orientation property is supported on Android devices from 2.6 namespace onwards.
Higher quality settings produce better rendering of scaled bitmaps. However, higher quality settings are computationally more expensive. In particular, when rendering scaled video, using higher quality settings can reduce the frame rate.
In the desktop profile of Adobe AIR,
For content running in Adobe AIR, setting the
If the
The area has a size of zero (0,0,0,0) when the soft keyboard is not visible.
When the keyboard opens, the
Note: On Android, the area covered by the keyboard is estimated when
the operating system does not provide the information necessary to determine the exact
area. This problem occurs in fullscreen mode and also when the keyboard opens in response to
an InteractiveObject receiving focus or invoking the
If the value of the
Air for TV devices have slightly different behavior than desktop devices
when you set the
Note: In an HTML page hosting the SWF file, both the
You can use only a limited number of StageVideo objects at a time. When a SWF begins to run, the number of available StageVideo objects depends on the platform and on available hardware.
To use a StageVideo object, assign a member of the
All StageVideo objects are displayed on the stage behind any display objects.
The StageVideo objects are displayed on the stage in the order they appear in
the
Use the
Note: AIR for TV devices support only one StageVideo object.
If the value of the
Air for TV devices have slightly different behavior than desktop devices
when you set the
Note: In an HTML page hosting the SWF file, both the
You can use the orientation strings included in this list as parameters for
the
The possible orientations include:
Note: Do not use the
Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a width
of 0, even if you try to set
Specifically, the
In other words, the
The
For Flash Player in a browser, GPU compositing can be requested by the value of
However, the
Note: This property is always
The properties defined in the initialization options cannot be changed after a window is created.
Note: For the initial application window created automatically
by AIR, all of these properties (except
The default values of the newly created object are:
For windows with system chrome, this setting will affect the appearance of the window maximize button. It will also affect other parts of the system-managed user interface, such as the window menu on Microsoft Windows.
When set to
OS behavior notes:
For windows with system chrome, this setting will affect the appearance of the window minimize button. It will also affect other parts of the system-managed user interface, such as the window menu on Microsoft Windows.
When set to
Note: Some Linux window managers allow windows to be minimized by the user even when the
When a window has an owner, that window is always displayed in front of its owner, is minimized and hidden along with its owner, and closes when its owner closes.
When set to
OS behavior notes:
Chrome refers to the window controls that allow a user to control the desktop properties of a window. System chrome uses the standard controls for the desktop environment in which the AIR application is run and conforms to the standard look-and-feel of the native operating system.
To use chrome provided by a framework (such as Flex), or to provide your own window
chrome, set
Constants for the valid values of this property are defined in the NativeWindowSystemChrome class:
If not specified, the default value for
Setting the
If
Setting the
Note: Not all Linux window managers support transparency. On such systems, transparent areas of a window are composited against black.
Constants for the valid values of this property are defined in the NativeWindowType class:
If not specified, the default value for
A ShaderParameter instance representing a parameter
for a Shader instance is accessed as a property of the Shader instance's
In addition to the defined properties of the ShaderParameter class,
each ShaderParameter instance has additional properties
corresponding to any metadata defined for the parameter. These properties
are added to the ShaderParameter object when it is created. The properties'
names match the metadata names specified in the shader's source code.
The data type of each property varies according to the data type of the
corresponding metadata. A text metadata value such as "description" is a String
instance. A metadata property with a non-string value (such as
For example, suppose a shader includes the following two parameter declarations:
The ShaderParameter instance
corresponding to the
The ShaderParameter corresponding to the
Generally, developer code does not create a ShaderParameter instance directly. A ShaderParameter instance is created for each of a shader's parameters when the Shader instance is created.
The following table indicates the parameter type and corresponding
number and data type of the
For the matrix parameter types, the array elements fill the rows of
the matrix, then the columns. For example, suppose the following line
of ActionScript is used to fill a
Within the shader, the matrix elements have the following values:
For example, consider a simple linear gradient between two colors (with the
You can access LoaderInfo objects in two ways:
The
When you use a Loader object to load a display object (such as a SWF file or a bitmap), the
The following diagram shows the different uses of the LoaderInfo object—for the instance of the main class of
the SWF file, for the
When a loading operation is not complete, some properties of the
Note: All properties of LoaderInfo objects are read-only.
The
Important: This example requires that you add a file named Image.gif in the same directory as the compiled SWF file. Use an image that has an area that fits within the dimensions of the main SWF file.
For example, an
The
Note: This property always has a value of either
All code in a SWF file is defined to exist in an application domain. The current application domain is where your main application runs. The system domain contains all application domains, including the current domain and all classes used by Flash Player or Adobe AIR.
All application domains, except the system domain, have an associated parent domain.
The parent domain of your main application's
For usage examples of application domains, see the "Client System Environment" chapter in the ActionScript 3.0 Developer's Guide.
Before the first
For more information related to security, see the Flash Player Developer Center Topic:
For more information related to security, see the Flash Player Developer Center Topic:
For more information related to security, see the Flash Player Developer Center Topic:
This value may differ from the actual frame rate in use. Flash Player or Adobe AIR only uses a single frame rate for all loaded SWF files at any one time, and this frame rate is determined by the nominal frame rate of the main SWF file. Also, the main frame rate may not be able to be achieved, depending on hardware, sound synchronization, and other factors.
Note: The
For application content in AIR, the value of this property is always
For more information related to security, see the Flash Player Developer Center Topic:
You can use a
The two sources of parameters are: the query string in the
URL of the main SWF file, and the value of the
The
The value of the
For more information related to security, see the Flash Player Developer Center Topic:
This property is created when the SWF associated with this LoaderInfo has finished
loading. Until then the
In the constructor, the code registers a listener for the
In the
Before the first
In some cases, the value of the
This class lets you separate bitmap rendering operations from the internal display updating routines of Flash Player. By manipulating a BitmapData object directly, you can create complex images without incurring the per-frame overhead of constantly redrawing the content from vector data.
The methods of the BitmapData class support effects that are not available through the filters available to non-bitmap display objects.
A BitmapData object contains an array of pixel data. This data can represent either a fully opaque bitmap or a transparent bitmap that contains alpha channel data. Either type of BitmapData object is stored as a buffer of 32-bit integers. Each 32-bit integer determines the properties of a single pixel in the bitmap.
Each 32-bit integer is a combination of four 8-bit channel values (from 0 to 255) that describe the alpha transparency and the red, green, and blue (ARGB) values of the pixel. (For ARGB values, the most significant byte represents the alpha channel value, followed by red, green, and blue.)
The four channels (alpha, red, green, and blue) are represented as numbers
when you use them with the
You can attach BitmapData objects to a Bitmap object by using the
You can use a BitmapData object to fill a Graphics object by using the
In the AIR runtime, the DockIcon, Icon, InteractiveIcon, and SystemTrayIcon classes each include
a
In AIR 1.5 and Flash Player 10, the maximum size for a BitmapData object is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels. (So, if a BitmapData object is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height and 2,880 in width.
Calls to any method or property of a BitmapData object throw an ArgumentError error if
the BitmapData object is invalid (for example, if it has
Notes:
By default, the bitmap is created as transparent, unless you pass the value
In AIR 1.5 and Flash Player 10, the maximum size for a BitmapData object is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels. (So, if a BitmapData object is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height and 2,880 pixels in width. If you specify a width or height value that is greater than 2880, a new instance is not created.
This method relies on the behavior of built-in filter objects, which determine the destination rectangle that is affected by an input source rectangle.
After a filter is applied, the resulting image can be larger than the input image.
For example, if you use a BlurFilter class
to blur a source rectangle of (50,50,100,100) and a
destination point of (10,10), the area that changes in the
destination image is larger than (10,10,60,60) because of
the blurring. This happens internally during the
If the
If the BitmapData object and the object specified as the
For example, consider the following two BitmapData objects:
Note: The colors used to fill the two BitmapData objects have slightly different RGB values
(0xFF0000 and 0xFFAA00). The result of the
Consider the following two BitmapData objects, in which the RGB colors are the same, but the alpha values are different:
The result of the
If the BitmapData objects are equivalent (with the same width, height, and identical pixel values), the method returns the number 0.
If the widths of the BitmapData objects are not equal, the method returns the number -3.
If the heights of the BitmapData objects are not equal, but the widths are the same, the method returns the number -4.
The following example compares two Bitmap objects with different widths (50 and 60):
The source channel value and destination channel value can be one of following values:
If you include the
The
When the
Drawing a bitmap with
This method directly corresponds to how objects are drawn with the standard vector renderer for objects in the authoring tool interface.
The source display object does not use any of its applied transformations
for this call. It is treated as it exists in the library or
file, with no matrix transform, no color transform, and no blend
mode. To draw a display object (such as a movie clip) by using its own transform properties,
you can copy its
This method is supported over RTMP in
If the source object and (in the case of a Sprite or MovieClip object) all
of its child objects do not come from the same domain as the caller, or are not in a content that is
accessible to the caller by having called the
There are also restrictions on using a loaded bitmap image as the
On Windows, the
The
For example, a blur filter normally affects an area larger than the size of the original
image. A 100 x 200 pixel image that is being filtered by a default BlurFilter
instance, where
Some filters clip their destination rectangle based on the source image size.
For example, an inner
For example, if you have a source image and you want to determine the rectangle of
the image that contains a nonzero alpha channel, pass
All pixels in a BitmapData object are stored as premultiplied color values. A premultiplied image pixel has the red, green, and blue color channel values already multiplied by the alpha data. For example, if the alpha value is 0, the values for the RGB channels are also 0, independent of their unmultiplied values. This loss of data can cause some problems when you perform operations. All BitmapData methods take and return unmultiplied values. The internal pixel representation is converted from premultiplied to unmultiplied before it is returned as a value. During a set operation, the pixel value is premultiplied before the raw image pixel is set.
All pixels in a BitmapData object are stored as premultiplied color values. A premultiplied image pixel has the red, green, and blue color channel values already multiplied by the alpha data. For example, if the alpha value is 0, the values for the RGB channels are also 0, independent of their unmultiplied values. This loss of data can cause some problems when you perform operations. All BitmapData methods take and return unmultiplied values. The internal pixel representation is converted from premultiplied to unmultiplied before it is returned as a value. During a set operation, the pixel value is premultiplied before the raw image pixel is set.
If an image is an opaque image, it is considered a fully opaque rectangle for this method. Both images must be transparent images to perform pixel-level hit testing that considers transparency. When you are testing two transparent images, the alpha threshold parameters control what alpha channel values, from 0 to 255, are considered opaque.
The
Flash runtimes use the following steps to generate the resulting image:
Cross-channel effects can be supported with this method. Each input array can contain full 32-bit values, and no shifting occurs when the values are added together. This routine does not support per-channel clamping.
If no array is specified for a channel, the color channel is copied from the source image to the destination image.
You can use this method for a variety of effects such as general palette mapping (taking one channel and converting it to a false color image). You can also use this method for a variety of advanced color manipulation algorithms, such as gamma, curves, levels, and quantizing.
The Perlin noise generation algorithm interpolates and combines individual random noise functions (called octaves) into a single function that generates more natural-seeming random noise. Like musical octaves, each octave function is twice the frequency of the one before it. Perlin noise has been described as a "fractal sum of noise" because it combines multiple sets of noise data with different levels of detail.
You can use Perlin noise functions to simulate natural phenomena and landscapes, such as wood grain, clouds, and mountain ranges. In most cases, the output of a Perlin noise function is not displayed directly but is used to enhance other images and give them pseudo-random variations.
Simple digital random noise functions often produce images with harsh, contrasting points. This kind of harsh contrast is not often found in nature. The Perlin noise algorithm blends multiple noise functions that operate at different levels of detail. This algorithm results in smaller variations among neighboring pixel values.
If the source image does not equal the destination image, pixels are copied from the source to the destination by using all of the properties. This process allows dissolving from a blank image into a fully populated image.
If the source and destination images are equal, pixels are
filled with the
All pixels in a BitmapData object are stored as premultiplied color values. A premultiplied image pixel has the red, green, and blue color channel values already multiplied by the alpha data. For example, if the alpha value is 0, the values for the RGB channels are also 0, independent of their unmultiplied values. This loss of data can cause some problems when you perform operations. All BitmapData methods take and return unmultiplied values. The internal pixel representation is converted from premultiplied to unmultiplied before it is returned as a value. During a set operation, the pixel value is premultiplied before the raw image pixel is set.
Note: To increase performance, when you use the
Note: To increase performance, when you use the
The
The
There are several restrictions on an AVM1 SWF file loaded by an AVM2 SWF file:
The ShaderInput instance representing a Shader instance's input image
is accessed as a property of the Shader instance's
For some uses of a Shader instance, you do not need to specify an input image, because it is automatically specified by the operation. You only need to specify an input when a Shader is used for the following:
If the shader is being executed using a ShaderJob instance to process a
ByteArray containing a linear array of data, set the ShaderInput instance's
Generally, developer code does not create a ShaderInput instance directly. A ShaderInput instance is created for each of a shader's inputs when the Shader instance is created.
If a ByteArray value is assigned to the
If a Vector.<Number> instance is assigned to the
A shader defines a function that executes on all the pixels in an image, one pixel at a time. The result of each call to the function is the output color at that pixel coordinate in the image. A shader can specify one or more input images, which are images whose content can be used in determining the output of the function. A shader can also specify one or more parameters, which are input values that can be used in calculating the function output. In a single shader execution, the input and parameter values are constant. The only thing that varies is the coordinate of the pixel whose color is the function result. Shader function calls for multiple output pixel coordinates execute in parallel to improve shader execution performance.
The shader bytecode can be loaded at run time using a URLLoader instance. The following example demonstrates loading a shader bytecode file at run time and linking it to a Shader instance.
You can also embed the shader into the SWF at compile time using the
In either case, you link the raw shader (the
Once a Shader instance is created, it can be used in one of several ways:
Shader fills, filters, and blends are not supported under GPU rendering.
Mobile Browser Support: This feature is not supported in mobile browsers.
AIR profile support: This feature is supported
on all desktop operating systems, but it is not supported on all mobile devices. It is not supported on AIR
for TV devices. See
Note that this example assumes there's a shader bytecode file named "donothing.pbj" in the same
directory as the output directory for the application. The Pixel Bender source code for the DoNothing shader
is available in the
Note that this example assumes there's a shader bytecode file named "donothing.pbj" in the same
directory as the source code for the application, and that the Flex SDK is used to compile the SWF.
The Pixel Bender source code for the DoNothing shader
is available in the
For information about accessing and manipulating the dynamic properties of
the
The set of possible values for the
The default value is
Full precision mode (
Fast precision mode (
The precision mode selection affects the following shader operations. These operations are faster on an Intel processor with the SSE instruction set:
Unlike the Sprite object, a MovieClip object has a timeline.
>In Flash Professional, the methods for the MovieClip class provide the same functionality as actions that target movie clips. Some additional methods do not have equivalent actions in the Actions toolbox in the Actions panel in the Flash authoring tool.
Children instances placed on the Stage in Flash Professional cannot be accessed by code from within the
constructor of a parent instance since they have not been created at that point in code execution.
Before accessing the child, the parent must instead either create the child instance
by code or delay access to a callback function that listens for the child to dispatch
its
If you modify any of the following properties of a MovieClip object that contains a motion tween,
the playhead is stopped in that MovieClip object:
Note:Flash Lite 4 supports the MovieClip.opaqueBackground property only if FEATURE_BITMAPCACHE is defined. The default configuration of Flash Lite 4 does not define FEATURE_BITMAPCACHE. To enable the MovieClip.opaqueBackground property for a suitable device, define FEATURE_BITMAPCACHE in your project.
The
If the movie clip contains multiple scenes, the
If the movie clip contains multiple frames, the
You can change the
A constant is defined to name each edge and corner of a window.
When you call some methods, you can use the bitwise OR operator (
The BitmapDataChannel constants are provided for use as values in the following:
Use a GraphicsSolidFill object with the
The following example shows the same gradient fill using various spread methods:
Use a GraphicsShaderFill object with the
The coordinates received in the shader are based on the matrix that is specified
for the
When you pass a Shader instance as an argument the shader is copied internally and the drawing fill operation uses that internal copy, not a reference to the original shader. Any changes made to the shader, such as changing a parameter value, input, or bytecode, are not applied to the copied shader that's used for the fill.
The Sprite class also includes a
Note that even though the parameter only expects a single value,
the
Note that even though the parameter only expects a single value,
the
Note that even though the parameter only expects a single value,
the
When paths intersect or overlap, the winding direction determines the rules for filling the areas created by the intersection or overlap:
Use a GraphicsPath object with the
The GraphicsPath class also has its own set of methods (
The values in this class are used by the
The
The