mardi 27 septembre 2016

How to save multiple movie clip into an image air for android

I am creating a dress-up game, where the dynamic movie clip can also be save as an image. Unfortunately, I was only able to save the image of 1 movie clip. Can anyone please help. I am new to flash. Thanks

Here is my code:

function fl_ClickToGoToAndStopAtFrame_18(event:MouseEvent):void
   {

GirlDone_btn.removeEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_18);
GirlDone_btn.visible = false;
var jpgSource:BitmapData = new BitmapData(480, 386.15, false);
jpgSource.draw(GirlBg_mc); 
var jpgEncoder:JPGEncoder = new JPGEncoder(100); 
var imgByteData:ByteArray = jpgEncoder.encode(jpgSource);

var file = new FileReference();

file.save(imgByteData, ".jpg");

if( CameraRoll.supportsAddBitmapData ){
new CameraRoll().addBitmapData(jpgSource);
GirlDone_btn.visible = true;
GirlDone_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_18);

}
}

Aucun commentaire:

Enregistrer un commentaire