2 Replies Latest reply on Nov 14, 2006 8:55 AM by boyBacon

    exportPNG

    Stephen_R_Davis
      i'm using flash 8. i'm not particularly farmiliar with ActionScript structure, so i looked in Flash Help. i found this:

      Example
      The following example exports the current frame in the current document to myFile.png, using the current PNG publish settings:

      fl.getDocumentDOM().exportPNG("file:///C|/myProject/myFile.png", true, true);


      however, i tried putting this in an on(release) handler for a button, and nothing happened. any ideas? thanks.
        • 1. Re: exportPNG
          NSurveyor Level 2
          People do this all the time... exportPNG is a JSFL command, not ActionScript. JSFL allows you to write useful scripts to execute IN the authoring environment. It is similar to using File > Export Image (.png). But clearly this isn't there during runtime.

          However, if you do want to export the image, you can use the BitmapData class in conjunction with some server side like PHP to save a file to the server. And then, you can use the FileReference class to create a download in which the user can select where to save the file. Check out: http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php for more info.
          • 2. Re: exportPNG
            boyBacon
            Hi there. Came across this thread whilst looking for a solution to my problem (exporting to an image/pdf at runtime).

            I notice you mentioned the sepiroth article, which I've read and is useful. However, to export each pixel of a large, complicated image using BitmapData can be incredibly slow... anyone know of a faster solution?