beautypg.com

Timeline.reorderlayer() – Adobe Extending Flash Professional CS5 User Manual

Page 511

background image

489

EXTENDING FLASH PROFESSIONAL

Timeline object

Last updated 5/2/2011

Parameters

startFrame

Specifies the first frame at which to start removing motion objects. If you omit startFrame, the method

uses the current selection; if there is no selection, all frames at the current playhead on all layers are removed. This
parameter is optional.

endFrame

Specifies the frame at which to stop removing motion objects; the range of frames goes up to, but does not

include, endFrame. If you specify only startFrame, endFrame defaults to the startFrame value. This parameter is
optional.

Returns
Nothing.

Description
Method; removes the motion object and converts the frame(s) back to static frames. The parameters are optional, and
if specified set the timeline selection to the indicated frames prior to removing the motion object.

Example
The following example deletes all motion objects and converts the frames back to static frames at the current playhead
position on the top layer:

fl.getDocumentDOM().getTimeline().currentLayer = 0;

fl.getDocumentDOM().getTimeline().removeMotionObject();

The following example deletes motion objects from Frame 5 up to, but not including, Frame 15 of the top layer in the
current scene:

fl.getDocumentDOM().getTimeline().currentLayer = 0;

fl.getDocumentDOM().getTimeline().removeMotionObject(5, 15);

See also

timeline.createMotionObject()

” on page 471

timeline.reorderLayer()

Availability
Flash MX 2004.

Usage

timeline.reorderLayer(layerToMove, layerToPutItBy [, bAddBefore])

Parameters

layerToMove

A zero-based index that specifies which layer to move.

layerToPutItBy

A zero-based index that specifies which layer you want to move the layer next to. For example, if

you specify 1 for layerToMove and 0 for layerToPutItBy, the second layer is placed next to the first layer.

bAddBefore

Specifies whether to move the layer before or after layerToPutItBy. If you specify

false

, the layer is

moved after layerToPutItBy. The default value is

true

. This parameter is optional.

This manual is related to the following products: