Timeline.currentframe, Timeline.currentlayer – Adobe Extending Flash Professional CS5 User Manual
Page 495
473
EXTENDING FLASH PROFESSIONAL
Timeline object
Last updated 5/2/2011
Example
The following example converts the shape in the first frame up to, but not including, Frame 10 to a graphic symbol
instance and sets the
frame.tweenType
to
motion
(remember that index values are different from frame number
values):
fl.getDocumentDOM().getTimeline().createMotionTween(0, 9);
timeline.currentFrame
Availability
Flash MX 2004.
Usage
timeline.currentFrame
Description
Property; the zero-based index for the frame at the current playhead location.
Example
The following example sets the playhead of the current timeline to Frame 10 (remember that index values are different
from frame number values):
fl.getDocumentDOM().getTimeline().currentFrame = 9;
The following example stores the value of the current playhead location in the
curFrame
variable:
var curFrame = fl.getDocumentDOM().getTimeline().currentFrame;
timeline.currentLayer
Availability
Flash MX 2004.
Usage
timeline.currentLayer
Description
Property; the zero-based index for the currently active layer. A value of 0 specifies the top layer, a value of 1 specifies
the layer below it, and so on.
Example
The following example makes the top layer active:
fl.getDocumentDOM().getTimeline().currentLayer = 0;
The following example stores the index of the currently active layer in the
curLayer
variable:
var curLayer = fl.getDocumentDOM().getTimeline().currentLayer;