Exporting the last frame as JPG file using Action Script

Hello,

Dynamically using the actionscript i want to export last frame as JPG or GIF file.

Can we do this ? Please let me know

Dhiru