Dynamically save a movieclip as a .GIF file on server?

Hello,

I was wondering if anyone has any experience with code that would take a MovieClip in a flash movie and save it to the server as a .GIF or .JPEG file on the fly? I assume this would be done with the BitmapData class but I have no idea where to go from there, as I am new with this class…

Thanks for any help!