Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 168

Programming actionscript 3.0
Table of Contents

Advertisement

Any display objects that you create without using ActionScript—for example, by adding an
MXML tag in Adobe Flex Builder 2 or by using a drawing tool in Flash—are added to the
display list. Although you do not add these display objects through ActionScript, you can
access them through ActionScript. For example, the following code adjusts the width of an
object named
button1
button1.width = 200;
Working with display object containers
If a DisplayObjectContainer object is deleted from the display list, or if it is moved or
transformed in some other way, each display object in the DisplayObjectContainer is also
deleted, moved, or transformed.
A display object container is itself a type of display object—it can be added to another display
object container. For example, the following image shows a display object container,
, that contains one outline shape and four other display object containers (of
pictureScreen
type PictureFrame):
In order to have a display object appear in the display list, you must add it to a display object
container that is on the display list. You do this by using the
method of the container object. For example, without the final line of the
addChildAt()
following code, the
myTextField
var myTextField:TextField = new TextField();
168
Display Programming
that was added in the authoring tool (not through ActionScript):
object would not be displayed:
A shape defining
the border of the
pictureScreen
display object
container
Four display object
containers that are
children of the
pictureScreen
object
method or the
addChild()

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents