From eaf14956b7f58273b7ba4bad5840baf3c664ecf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 8 Aug 2024 19:25:57 +0200 Subject: [PATCH] Fixed: #2268 AS3 script export with embedded assets fails (_assets dir not exists) when no other than sprite assets exist --- CHANGELOG.md | 4 ++++ .../decompiler/flash/exporters/script/AS3ScriptExporter.java | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dbd532ce..d68966b7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file. ### Fixed - [#2267] Script decompilation - Loop detection causing `§§goto` instructions in some cases +- [#2268] AS3 script export with embedded assets fails (_assets dir not exists) + when no other than sprite assets exist ## [21.0.0] - 2024-08-05 ### Added @@ -3470,6 +3472,8 @@ Major version of SWF to XML export changed to 2. [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 [#2221]: https://www.free-decompiler.com/flash/issues/2221 +[#2267]: https://www.free-decompiler.com/flash/issues/2267 +[#2268]: https://www.free-decompiler.com/flash/issues/2268 [#2176]: https://www.free-decompiler.com/flash/issues/2176 [#2179]: https://www.free-decompiler.com/flash/issues/2179 [#2185]: https://www.free-decompiler.com/flash/issues/2185 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS3ScriptExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS3ScriptExporter.java index bb508a18f..3b248eed3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS3ScriptExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS3ScriptExporter.java @@ -571,6 +571,7 @@ public class AS3ScriptExporter { } if (!spriteTagList.isEmpty()) { new RetryTask(() -> { + Path.createDirectorySafe(new File(ASSETS_DIR)); try (FileOutputStream fos = new FileOutputStream(ASSETS_DIR + "/assets.swf")) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SWFOutputStream sos2 = new SWFOutputStream(baos, swf.version, swf.getCharset());