Timeline.createmotiontween() – Adobe Extending Flash Professional CS5 User Manual
Page 494

472
EXTENDING FLASH PROFESSIONAL
Timeline object
Last updated 5/2/2011
endFrame
Specifies the frame at which to stop creating 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; creates a new motion object. The parameters are optional, and if specified set the timeline selection to the
indicated frames prior to creating the motion object.
Example
The following example creates a motion objects at the current playhead position on the top layer:
fl.getDocumentDOM().getTimeline().currentLayer = 0;
fl.getDocumentDOM().getTimeline().createMotionObject();
The following example creates a motion object starting at Frame 5, and extending up to, but not including, Frame 15
of the top layer in the current scene:
fl.getDocumentDOM().getTimeline().currentLayer = 0;
fl.getDocumentDOM().getTimeline().createMotionObject(5, 15);
timeline.createMotionTween()
Availability
Flash MX 2004.
Usage
timeline.createMotionTween([startFrameIndex [, endFrameIndex]])
Parameters
startFrameIndex
A zero-based index that specifies the beginning frame at which to create a motion tween. If you
omit startFrameIndex, the method uses the current selection. This parameter is optional.
endFrameIndex
A zero-based index that specifies the frame at which to stop the motion tween. The range of frames
goes up to, but does not include, endFrameIndex. If you specify only startFrameIndex, endFrameIndex defaults to the
startFrameIndex value. This parameter is optional.
Returns
Nothing.
Description
Method; sets the
property to
motion
for each selected keyframe on the current layer, and converts
each frame’s contents to a single symbol instance if necessary. This property is the equivalent to the Create Motion
Tween menu item in the Flash authoring tool.