Skip to main content
Participant
September 20, 2009
Question

"screenshot" with bitmapData.draw and fileReference.save?

  • September 20, 2009
  • 2 replies
  • 1750 views

I made this dress-up type game, and have been trying to figure out how to let the user save an image of their creation.

I've been researching and figured out I need to use bitmapData.draw and fileReference.save in the actionscript somewhere.

The only problem is I want this to be a standalone .swf if possible. The 'game' is here.

This is part of my code:

saveMe.addEventListener(MouseEvent.CLICK, saveChar);

function saveChar(evt:MouseEvent) {

     //what goes here? help please!

}

saveMe is the movieclip 'button' the user clicks on to launch the save dialog.

This topic has been closed for replies.

2 replies

AttaBoy2
Inspiring
September 20, 2009

I have an example http://www.jimslounge.com/bigShot/ kglad helped me get it working properly.

Just hit the local button to get a snapshot.

I'm attaching the code.  Actually the whole thing you have to run it from a server it won't run(download the image) locally unless you have a server with php setup on your machine.

kglad
Community Expert
Community Expert
September 20, 2009

you can't use flash to save a (non-sharedobject) file on the user's computer unless you use air.

gooseyAuthor
Participant
September 20, 2009

Actually you can, with Flash Player 10.

kglad
Community Expert
Community Expert
September 20, 2009

what class in a standalone swf are you using to save a file directly from flash to the user's computer?