Hello, GAF Fans!

You already know what GAF Converter can do and how cool it is! But understanding how it works will result in a more efficient performance and even more impressive results.

This article will raise the curtain on how GAF Converter magic works.

It will answer three simple but very important questions which are likely to arise in the mind of everyone interested in GAF.

These are:


1) How does GAF Converter select content for conversion?

GAF Converter converts content placed on a Main Timeline and in a Library (MovieClips exported for ActionScript).

Main Timeline. It doesn’t matter whether you create an animation on the Main Timeline or choose a MovieClip and further overlay it on the Main Timeline. All the content on the Main Timeline is a source for conversion.

Library. You can create an animation in a MovieClip and export it for ActionScript (create linkage). In this case you do not need to place the MovieClip instance on the Main Timeline. And this MovieClip will be a source for conversion.

You can also create several MovieClips and export all of them for ActionScript. In this case GAF Converter will create several separate animations with shared Texture Atlas. The same result can be achieved by converting several SWF files with the animation on the Main Timeline in a Bundle.

By default GAF Converter only converts content available on the Main Timeline. In order to enable conversion from a Library, go to the Settings Dialog and select the checkbox “Library (MovieClips exported for ActionScript)” in Conversion section.

2) How does the conversion work?

When converting an animation GAF Converter plays an SWF file in Adobe AIR runtime during the conversion process. It collects information about all Display Objects in the Display List when playing the animation frame by frame.

This means two important things. First: you can use any structure of your Display List on a Stage. You can create animations with any internal structure and any depth of nesting. Second: all Action Script 3 inside an SWF is executed and affects the result. You can apply Action Script 3 to control the animation playback starting from simple actions like stop(), gotoAndPlay(), etc. and up to complex code that fully creates and manages the whole animation.

When using Action Script 3 be sure to avoid endless animations. Otherwise you will get a conversion error  "animation can't reach end". To learn how GAF Converter defines the animation’s read below.

3) How does GAF Converter define animation’s end?

GAF Converter chooses a “Monitored Timeline” as a reference point for detecting the end of the animation. If the Main Timeline’s length is more than one frame, than the Main Timeline becomes the “Monitored Timeline”. If the Main Timeline is one frame long, GAF Converter analyzes the Display List of the first frame and finds the MovieClip with the longest Timeline. This MovieClip becomes the “Monitored Timeline”. GAF Converter stops conversion after the “Monitored Timeline” reaches the last frame.

It’s important to know that the length of a converted animation doesn’t always equal the length of the  “Monitored Timeline”. When analyzing the animation, GAF converter plays it back via Flash Player. If there is an ActionScript 3 code managing the “Monitored Timeline” playback (stop() gotoAndStop() gotoAndPlay() or any other code written in ActionScript 3) this code will run too.

If the animation on the “Monitored timeline” does not reach the last frame in the maximum possible number of frames in the animation, GAF converter displays "animation can't reach end" error. Maximum possible number of frames is 10000.

That's it. I hope this information will help you improve your experience with GAF Converter. More articles are coming soon. Stay tuned.

Best wishes!

Vadym Mitin,

GAF Team Lead