From 42ac10e4685020907109c976f4e2c807155b0d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 23 Feb 2026 21:11:54 +0100 Subject: [PATCH] Changed: #2642 Sprite SWF export - do not export as SWF timeline, use DefineSprite tag and PlaceObject of it --- CHANGELOG.md | 6 +++ .../flash/exporters/PreviewExporter.java | 54 ++++++++++--------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f589cf08..be9b11c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ All notable changes to this project will be documented in this file. - [#2639] Export to FLA - missing sound streams - Debugger - Threading issues with multiple SWFs - Debugger - Reading variables on 64bit flash players (like in browsers) +- DoInitAction should be ignored when exporting as SWF + +### Changed +- [#2642] Sprite SWF export - do not export as SWF timeline, use DefineSprite tag + and PlaceObject of it ### Removed - (Temporary) AS3 ambiguios namespace detection, it is slow - needs optimizations @@ -4154,6 +4159,7 @@ 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 [#2639]: https://www.free-decompiler.com/flash/issues/2639 +[#2642]: https://www.free-decompiler.com/flash/issues/2642 [#2636]: https://www.free-decompiler.com/flash/issues/2636 [#1209]: https://www.free-decompiler.com/flash/issues/1209 [#1850]: https://www.free-decompiler.com/flash/issues/1850 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/PreviewExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/PreviewExporter.java index bd35290ae..95b0921a5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/PreviewExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/PreviewExporter.java @@ -451,9 +451,7 @@ public class PreviewExporter { } } - if (!isSprite) { - writeTag((Tag) treeItem, sos2, doneCharacters); - } + writeTag((Tag) treeItem, sos2, doneCharacters); MATRIX mat = new MATRIX(); mat.hasRotate = false; @@ -650,29 +648,30 @@ public class PreviewExporter { new ShowFrameTag(swf).writeTag(sos2); first = false; } - } else if (treeItem instanceof DefineSpriteTag) { - DefineSpriteTag s = (DefineSpriteTag) treeItem; - Tag lastTag = null; - for (Tag t : s.getTags()) { - if (t instanceof EndTag) { - break; - } else if (t instanceof PlaceObjectTypeTag) { - PlaceObjectTypeTag pt = (PlaceObjectTypeTag) t; - MATRIX m = pt.getMatrix(); - MATRIX m2 = new Matrix(m).preConcatenate(new Matrix(mat)).toMATRIX(); - pt.writeTagWithMatrix(sos2, m2); - lastTag = t; - } else if (t instanceof DoActionTag) { - //ignore - } else { - t.writeTagNoScripts(sos2); - lastTag = t; - } - } - if (!s.getTags().isEmpty() && (lastTag != null) && (!(lastTag instanceof ShowFrameTag))) { - new ShowFrameTag(swf).writeTag(sos2); - } } else { + /* else if (treeItem instanceof DefineSpriteTag) { + DefineSpriteTag s = (DefineSpriteTag) treeItem; + Tag lastTag = null; + for (Tag t : s.getTags()) { + if (t instanceof EndTag) { + break; + } else if (t instanceof PlaceObjectTypeTag) { + PlaceObjectTypeTag pt = (PlaceObjectTypeTag) t; + MATRIX m = pt.getMatrix(); + MATRIX m2 = new Matrix(m).preConcatenate(new Matrix(mat)).toMATRIX(); + pt.writeTagWithMatrix(sos2, m2); + lastTag = t; + } else if (t instanceof DoActionTag) { + //ignore + } else { + t.writeTagNoScripts(sos2); + lastTag = t; + } + } + if (!s.getTags().isEmpty() && (lastTag != null) && (!(lastTag instanceof ShowFrameTag))) { + new ShowFrameTag(swf).writeTag(sos2); + } + }*/ new PlaceObject2Tag(swf, false, 1, chtId, mat, null, 0, null, -1, null).writeTag(sos2); new ShowFrameTag(swf).writeTag(sos2); } @@ -721,7 +720,10 @@ public class PreviewExporter { List chIdTags = t.getSwf().getCharacterIdTags(((CharacterIdTag) t).getCharacterId()); if (chIdTags != null) { for (CharacterIdTag chIdTag : chIdTags) { - if (!(chIdTag instanceof PlaceObjectTypeTag || chIdTag instanceof RemoveTag)) { + if (!(chIdTag instanceof PlaceObjectTypeTag + || chIdTag instanceof RemoveTag + || chIdTag instanceof DoInitActionTag + )) { Set needed = new LinkedHashSet<>(); ((Tag) chIdTag).getNeededCharactersDeep(needed, new HashSet<>());