A timeline is a tree of elements: the timeline holds layers, each layer holds its
keyframes, and each keyframe holds its script and what is on the stage while it lasts.
A scene’s timeline is in DOMDocument.xml; a symbol’s is in its own file in
LIBRARY/, with the same elements.
<DOMLayer name="[actionscript]" color="#FFFF4F" current="true" isSelected="true" autoNamed="false">
<frames>
<DOMFrame index="0" keyMode="9728">
<Actionscript>
<script><![CDATA[//----------------------------------------------------------
// Very simple preloader
//----------------------------------------------------------
if (this.stage.loaderInfo.bytesLoaded / this.stage.loaderInfo.bytesTotal >=1)
gotoAndStop("connect");]]></script>
</Actionscript>
<elements/>
</DOMFrame>
<DOMFrame index="1" duration="7" keyMode="9728"> …
DOMTimeline
In DOMDocument.xml, <timelines> holds one
<DOMTimeline> for each scene; in a symbol file,
<timeline> holds the symbol’s one <DOMTimeline>.
Its name is the scene’s name (such as Scene 1) or the
symbol’s. Its child <layers> holds the layers.
DOMLayer
| Attribute | Meaning |
|---|---|
name | The layer’s name, such as [actionscript]. |
color | The outline colour shown for the layer, as #RRGGBB. |
current | true on the layer that was current when the document was saved. |
isSelected | true on selected layers. |
autoNamed | false when the user named the layer. |
layerType | The kind of layer. Absent on ordinary layers. |
parentLayerIndex | The position, in the same <layers> list, of the layer this one belongs under; by its name, a layer folder or guide (an inference). |
A layer’s child <frames> holds its keyframes.
DOMFrame
Only keyframes are written, one <DOMFrame> each, in order. The
frames between keyframes are covered by the durations.
| Attribute | Meaning |
|---|---|
index | The first frame of the keyframe, counted from 0. Flash shows frame index + 1. |
duration | How many frames it lasts; 1 when absent. |
keyMode | A number for the kind of keyframe: 9728 for an ordinary keyframe and 22017 for a motion tween in the files seen. 9728 is 0x2600, the same value a binary FLA of Flash CS4 stores in its frame record. |
tweenType | The kind of tween that starts at this keyframe, when there is one. |
name | The frame label. |
So in the example, the keyframe with index="0" is frame 1, and the one
with index="1" duration="7" covers frames 2 to 8. The explorer labels
each script with this frame number.
A frame holds, as children:
<Actionscript>– the frame script, in a<script>element; see ActionScript in FLA<elements>– what is on the stage in this keyframe (below); empty as<elements/>on a scripts layer<MorphShape>– the shape tween, on a keyframe that starts one
Elements on the stage
<elements> lists the things on the stage in the keyframe:
| Element | Is |
|---|---|
<DOMShape> | A shape drawn on the stage: fills, strokes and edges. See Shapes and edge encoding. |
<DOMGroup> | A group of elements. |
<DOMSymbolInstance> | An instance of a library symbol (below). |
<DOMBitmapInstance> | A bitmap from the library placed on the stage. |
<DOMStaticText> | A static text field. |
These are the kinds found in the files examined for this site; Flash has others, for other kinds of text, for video and so on.
Symbol instances
A <DOMSymbolInstance> places a symbol from the library:
| Attribute or child | Meaning |
|---|---|
libraryItemName | The symbol’s name in the library, with its folder path. |
symbolType | The kind of instance, such as button or graphic. |
name | The instance name, by which scripts refer to it. |
<matrix><Matrix a b c d tx ty/></matrix> | Where it is and how it is scaled, rotated and skewed: an affine matrix, with tx and ty the translation. |
<Actionscript> | ActionScript 1.0 and 2.0 handlers on the instance, such as on (release) { … }; see ActionScript in FLA. |
Tweens
A tween is stored on the keyframe where it starts, and runs for that keyframe’s duration, to the next keyframe:
- A motion tween marks the keyframe with
tweenTypeand akeyModeof its own (22017in the files seen). - A shape tween also stores a
<MorphShape>on the starting keyframe: the matched outlines, as<MorphSegment>and<MorphCurves>elements whose coordinates use the same#hexadecimal numbers as edges. See Shapes and edge encoding.
Tweens can also carry easing and other settings, which are not described here.