1

Maybe my question is simple, but I can't find a solution :-( Task: I need to save MovieClip as a picture-png. I use this code:

photoContainer_mc.cache(0, 0, 100, 100, 0.8);
window.open(photoContainer_mc.getCacheDataURL());

It works, but it's a very ugly option. There are other options to save a MovieClip as an image-png? Thanks.

  • Nope, this is the best way! There aren't other approaches. I think its pretty elegant :) – Lanny Jan 29 '19 at 22:35
  • Sadly :-( People are used to a different way of saving images. Lanny, can I use FileSaver (or analogues) to save MovieClip as an image-png? Thanks. – Дмитрий Егоров Jan 30 '19 at 11:25
  • There is no built-in functionality, other than the raw canvas toDataURL(). Might make sense to expose `toBlob()` as well. You can always access the canvas and context manually to handle this yourself, and integrate something like FileSaver. – Lanny Jan 30 '19 at 19:48
  • About the canvas is clear, but interested MovieClip :-( Thank you very much, Lanny. – Дмитрий Егоров Jan 31 '19 at 11:58
  • What are you specifically trying to do? If you want all frames exported from a MovieClip, you could use SpriteSheetBuilder, which generates a SpriteSheet texture, and can accept a MovieClip as a source. Feel free to open a more specific question. – Lanny Jan 31 '19 at 13:22

0 Answers0