Wednesday, October 29, 2008

SWF TimeLine

Flash player plays SWF by frames. This happens when flash player "meets" tagShowFrame, i.e. no changes in animation can be seen without this tag. Frame rate is specified in file title as FPS value. The summary duration of playing SWF can be calculated by multiplying the number of frames by FPS (Frames per Second) value.

This is theory, but in practice everything is much more difficult and that's why.

The matter is SWF can be not a simple movie, but a complicated logic script with interactivity elements. Frames can be changed in whatever sequence, including the one with stopping on a frame to wait user reaction. In fact, such SWFs are web applications.

Besides, in a movie, one can use special objects Sprites, in terms of Flash IDE they are called MovieClips. Sprites have the same structure as SWF (a set of tags) and their own timeline. There are SWFs with only one SWF frame where all the animation takes place in sprites.

And the last. Sometimes flash player can't prepare frame for playing in time. As a rule, this happens when there is a transformation of images or superposition of multiple masks in a frame. In this cases, frames are changed obviously more seldom than it's specified in FPS.


Conclusion. In most cases it's IMPOSSIBLE to determine duration of SWF. In most cases it's IMPOSSIBLE to scroll SWF for example to the third frame if you don't know movie structure and script. In most cases it's IMPOSSIBLE to know if an SWF finished playing, because "the action" can take place not in the main timeline, but in sprites.

No comments:

Post a Comment