user63898
user63898

Reputation: 30895

how to extract flash frames programmatically

i need to extract frame (can be every number ) from flash swf and convert it to jpg/png/.. programmatically what is the best way to do that ? never mind the programming lang

Upvotes: 2

Views: 3384

Answers (2)

Marco Luglio
Marco Luglio

Reputation: 3603

Do you have the original .fla files or only the .swf ones?

Anyway, if your using Actionscript 3, then every instance of DisplayObject and its subclasses (Stage, Sprite, MovieClip...) can be captured to a Bitmap. To do that, create a BitmapData object and use its draw method.

It would look like something like this:

do {
    bitmapData.draw(someMC);
    //then send the data to some server-side page
    //using getPixel or some other solution
    someMC.nextFrame();
} while (someMC.currentFrame =< someMC.totalFrames)

For more info on how to transfer the image to a server-side page check this: http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php

If you only have the swf file, you can try to load it inside your own swf and run the above code.

Upvotes: 3

Paul Dixon
Paul Dixon

Reputation: 300835

Check out swfextract, part of swftools. It's a console app so you can easily drive it from your own software.

Upvotes: 1

Related Questions