beautypg.com

Layer.parentlayer, Layer.visible – Adobe Extending Flash Professional CS5 User Manual

Page 345

background image

323

EXTENDING FLASH PROFESSIONAL

Layer object

Last updated 5/2/2011

Description
Property; a Boolean value that specifies the status of outlines for all objects in the layer. If set to

true

, all objects in the

layer appear only with outlines. If

false

, objects appear as they were created.

Example
The following example makes all objects on the first layer appear only with outlines:

fl.getDocumentDOM().getTimeline().layers[0].outline = true;

layer.parentLayer

Availability
Flash MX 2004.

Usage

layer.parentLayer

Description
Property; a Layer object that represents the layer’s containing folder, guiding, or masking layer. The parent layer must
be a folder, guide, or mask layer that precedes the layer, or the

parentLayer

of the preceding or following layer. Setting

the layer’s

parentLayer

does not move the layer’s position in the list; trying to set a layer’s

parentLayer

to a layer

that would require moving it has no effect. Uses

null

for a top-level layer.

Example
The following example uses two layers at the same level on the same timeline. The first layer (

layers[0]

) is converted

into a folder and then set as the parent folder of the second layer (

layers[1]

). This action moves the second layer

inside the first layer.

var parLayer = fl.getDocumentDOM().getTimeline().layers[0];

parLayer.layerType = "folder";

fl.getDocumentDOM().getTimeline().layers[1].parentLayer = parLayer;

layer.visible

Availability
Flash MX 2004.

Usage

layer.visible

Description
Property; a Boolean value that specifies whether the layer’s objects on the Stage are shown or hidden. If set to

true

, all

objects in the layer are visible; if

false

, they are hidden. The default value is

true

.

This manual is related to the following products: