In Adobe Animate and with a .fla file (after importing a swf file, import to stage), I run this script

var exportFileName = 'file:///C|/temp/files/a.svg';
fl.getDocumentDOM().exportSVG(exportFileName, true, true);

it doesn't seem to do anything at all...no svg file is created at all. If I change exportSVG to exportPNG with the same parameters it does seem to work. I have found a couple of examples online using this exportSVG function but I can't find any official documentation (no documentation for exportPNG either).

Does anyone know how to make this work, know if it should work or at least might be able to point me to some documenation?

As additional info, if I add trace statements that the content of the output panel is wiped clean as soon as the exportSVG line gets hit. I've also played around with the parameters of exportSVG and nothing seems to work. If I use the file menu 'export (legacy)' and choose svg, I am able to export it manually

Using Adobe Animate CC v18.0 Build 107


All it needs is to set the svg properties in the publish settings dialog.

Make sure you check the 'SVG Image' option in the publish settings dialog and save the .fla file (this can all be done via script but I had a default .fla file that I then imported into, delete layers, save, then export svg)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.