F7 / F8 (AS2): Taking a "Screenshot" of the currnet Stage?

  • That's basically already my question... (Hello, by the way ^^)

    ...Is there a way to take a "screenshot" of what is currently being displayed on the stage? Or even better, a part of the stage?

    Don't get me wrong- I know how to take a screenshot *myself*. What I want is to have an option within the *SWF* to generate a file (jpg, png or gif are all fine) of what the current stage looks like.

    It sounds like a fairly easy idea / request but I have no clue how this would be done... that's why I'm begging for help =)

    It's for a shop (idea) where people can patch together their own design to be printed... but in order to do that, I would have to be able to generate an image of the completed design... any ideas? Am I missing something that's already integrated in Flash?

    Thanks in advance everyone for your suggestions and your time, reading this!

    ~Marcel


  • How spooky...I was just looking at this:
    http://www.sephiroth.it/tutorials/flashPHP/print_screen/


  • I've actually never done it in AS2, but others have and I know there are source files available for such examples. google should be able to help you there.


  • BitmapData.draw can do it but only in Flash Player 8+, and it wont generate a jpg or png. It will only give you the raw pixel information, but you can send that to a server script to actually generate those images dynamically.


  • Senocular saves the day =) I'll look into how to send (and then handle) the raw data. That might already be it... although I guess it would limit the target audience quite a bit if the newest Player was required. But I'll toy with that. Thanks again! XD


  • Wow guys. Thanks :)


  • you would have to create an array of pixelcolors for the whole image
    join the array with , or something . then send it to php and have php use the GD library to create a gif or jpg


  • You will have trouble if you want to encode it in anything other than bmp. Because the power of AVM1 is not sufficient enough to encode files. AVM2 is able to do encoding in the player itself, and Kourantin has the sources for that.

    The server side script... I can't remember how to do it. I used AMFPHP to do the job, when I was experimenting.


  • the newest player is 9. If you're targeting 9, its actually possible to compile a jpg or png in the player itself (using AS3), however, you still need some backend to push it back to the user as a file.


  • Okay. Was just wondering if you had a pointer, since you seem to be around right now =) ... Google is already my friend (am looking for files right now).

    So- at the risk of repeating myself- thanks for your time- I'll post my results on here if I don't forget =)


  • Yea I know the current version is 9 =)

    I'm a "Jack of [many] trades, master of none"... I know a little bit of (almost) everything but often not even enough to participate in a discussion. heh.

    But I've been working with Flash (MX and then 8) and AS 2 for a little over a year now and usually get along (sometimes crudely) at the tasks I need to do- but seeing someone who could- without overstating- be called a pro, such as "the Senocular" makes me see that I still have *alot* to learn =)

    I'd probably push it towards PHP and use the GD library to generate and save an image from it.

    Does Flash allow to call a PHP file which will handle the Image data "in the background" (silently, so to speak)? Or does it need to pass it to a target file, such as an iframe?

    Thanks again (and again and again) ^_^







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about F7 / F8 (AS2): Taking a "Screenshot" of the currnet Stage? , Please add it free.