0

I have a flash file where I load a remote SWF file into my own. Now what I want to do is convert that remote SWF file into a GIF that I can save onto my server.

The remote file is a SWF that has a variable amount of frames, and I somehow need to be able to figure out the amount of frames (I presume), and take a snapshot (picture) of every frame, to turn the taken pictures into a GIF file. That's what I THINK has to be done, however I have no idea if it's even possible to take pictures/snapshots of remote SWF files.

I need some serious suggestions on how I could get this working. I'm a serious Flash newbie, and anything would help.

dda
  • 6,030
  • 2
  • 25
  • 34
Dave Siegel
  • 203
  • 1
  • 10

2 Answers2

1

Trying to capture stage area using BitmapData

var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight);
bmd.draw(stage);

And this should help you creating the animated GIF: http://www.bytearray.org/?p=93

Community
  • 1
  • 1
roberkules
  • 6,557
  • 2
  • 44
  • 52
  • Would this work the same when the remote swf has been loaded as a MovieClip? – Dave Siegel Jun 14 '11 at 23:24
  • haven't tried it, but i suppose it should work. you should put the movieclip to the stage and iterate through the frames, taking one snapshot for each of those frames. – roberkules Jun 14 '11 at 23:25
1

You can use the totalFrames property to see how many frames there are and loop through them. You can draw the frames into a BitmapData object.

jhocking
  • 5,527
  • 1
  • 24
  • 38