Categories
Animation Flash Flash video player Open source / Freeware

Convert SWF to AVI (SWF2AVI or SWFtoAVI)

Update: are you looking for a userfriendly, free SWF>>AVI converter? Read also my post about SWF>>AVI

I was always under the assumption that you couldn’t export video with flash.
And yes I know …. there are couple ways to export video but they have some restrictions.

To export from Flash to Quicktime (MOV) means that you SWF can’t be higher than Flash 5 and in the standard export setting AVI and MOV can’t contain script, so everything has to be animated on root timeline even animation in movieclips don’t work.
There is also the possibility to export a sequence of images which has the same restriction…

swf2avi main

But since I use swf2avi I don’t have these restrictions no longer.
Swf2avi is very easy to use (what all programs with 1 aim should be). It’s quite intuitive! So no tutorial will be made by me, not even a small explanation.
Swf2avi will create a container (if necessary) to play your SWF frame-by-frame and creates screenshots of every frame in either BMP or JPG.
This sequence can be translated afterwards to AVI with swf2avi (with the possibility of compression), an AVI can be converted to FLV and play it with a flashVideoPlayer.


The only thing you have to remember that your script should be based upon frame-rate (fps) and not on time (milli-seconds).
The next examples are based on a FLA with framerate of 25 fps

Example 1:

/*
// this code doesn't work (very well) because it is based on time (seconds)
import mx.transitions.Tween;
var myTween: Tween = new Tween (this.ball_mc, '_x', mx.transitions.easing.Elastic.easeOut, 0, 300, 5, true);
*/
// this code will work: it's based on frames
import mx.transitions.Tween;
var myTween: Tween = new Tween (this.ball_mc, '_x', mx.transitions.easing.Elastic.easeOut, 0, 300, (5 * 25), false);

Example 2:

/*
// timebased: doesn't work
this.onEnterFrame = function () {
    this.time_txt.text = (getTimer ()/1000) +  " sec.";
};
*/ 
// based on framerate
this.onEnterFrame = function () {
     this.time_txt.text = (_root._currentframe / 25) + " sec.";
};

more information about mx.transitions: macromedia

One reply on “Convert SWF to AVI (SWF2AVI or SWFtoAVI)”

Comments are closed.