Reputation: 30895
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
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
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