Aiden
Aiden

Reputation: 399

Exporting AS3 animation to FLV using AS3

Is it possible to export an animation consisting of AS3 etc etc into a FLV file type using AS3 Code to do it rather than using manual progression

File > Export etc etc

Thanks

Aiden

Upvotes: 1

Views: 638

Answers (2)

charlesclements
charlesclements

Reputation: 86

You can look into this codebase, it may save you some time:

http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs/

var myWriter:SimpleFlvWriter = SimpleFlvWriter.getInstance();
myWriter.createFile(myFile, 320,240, 30, 120);
myWriter.saveFrame( myBitmapData1 );
myWriter.saveFrame( myBitmapData2 );
myWriter.saveFrame( myBitmapData3 ); // ... etc.
myWriter.closeFile();

Upvotes: 0

Pier
Pier

Reputation: 10827

It is a long shot, but depending on the conditions (CPU power, resolution, memory) it could work.

You should be able to make a BitmapData for every frame in your movie using bitmapData.draw(displayObject);. Then store all those bitmaps in an array, and then encode to flv using some external library such as this one.

Here's a tutorial on how to convert a displayObject into a BitmapData.

If instead of using Flash Player you compile to Adobe Air for desktop, you could save the frames as files in the hard drive, and then encode the sequence using a multitude of programs (such as After Effects) to any video format you want.

Upvotes: 2

Related Questions