Documentation
Dividing an animation on Sequences
Dividing an animation on sequences is useful when you need to split the animation into some logical segments. For example, a character animation can be split into following sequences: "walk", "stand" etc. Of course, you can create separate animations and change them during playback, but sequences-approach is much easier from all points of view.
How to prepare an animation in Flash Pro
Animation on Main Timeline (Stage)
To split animation into sequences in Flash Pro, you need to use Frame Labels. If your animation is placed on Main Timeline (Stage) do the following:
- Create new layer on Main Timeline and call it "Labels" (you can use any existing layer with any name, but we suggest you create a new one to make your workflow with labels more comfortable);
- Select first keyframe (first frame of your animation);
- Open Properties panel and in Label section enter a Name (for example "walk").
- Done. Now your animation contains one sequence "walk". It starts from the first frame and ends at the last frame of your animation.
In order to add one more sequence into the animation do the following:
- Find a frame from which you want to start second sequence (for example frame number 46);
- Select frame 46 on layer "Labels" and make it a Keyframe (press the F6 button on keyboard or right click the frame and select "Insert Keyframe" from context menu);
- Open Properties panel and in Label section enter a Name (for example "stand");
- Done. Now your animation contains two sequences: "walk" and "stand". The "walk" sequence starts from the first frame and ends at frame 45. The "stand" sequence starts from the frame 46 and ends at the last frame of your animation.
The first frame of the sequence is the frame where frame label is set. The last frame of the sequence is the last frame before the next frame with another frame label (or the last frame in animation if there are no more frame labels).
Animation in Library (Movie Clip exported for Action Script)
In case your animation is created inside a Movie Clip exported for Action Script, and you are using Conversion source: Library to convert the animation, the workflow is the same. The only difference is in the place where the layer "Labels" is created. In this case, it should be created inside a Movie Clip exported for Action Script (not on Stage).
Sequences in nested Movie Clips
You can set up sequences inside a nested Movie Clips. Nesting level is not limited. But GAF Converter will extract and save all nested sequences into GAF only when Conversion mode: Nesting is used. During the conversion using Conversion mode: Plain GAF Converter ignores all nested sequences. You can find more information about conversion modes and how to change them in the article How does the conversion work?.
How to playback/change sequences in runtime
Starling GAF
You can find an example of how to work with sequences in Starling GAF library in the sequences sample in the demo directory.
Cocos2D-X v3 GAF
Example for this library is under development and will be available in the near future.
Cocos2D-JS GAF
You can find an example of how to work with sequences in Cocos2D-JS GAF library in the sequences sample in the demo directory.
Unity3d GAF
Example for this library is under development and will be available in the near future.