var dt : Date = new Date();
var jpg:JPEGEncoder= new JPEGEncoder;
var ba:ByteArray = jpg.encode(parentDocument.newBitmapData);
file.save(ba,'Screenshot at'+dt.time+'.jpg');
I have to save the image in different sizes
for eg : 800x600, 640x480 etc