Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f087a7e
AnimateLibraryExporter: use lime.tools.AssetType for generated class …
dimensionscape Oct 26, 2026
edbab7f
Tools: write generated Flash/AIR classes to their lowercased package …
dimensionscape Oct 26, 2026
338fb9c
TagDefineFont2: fix parsing fonts without layout reading past the tag…
dimensionscape Oct 26, 2026
86b05c9
Keep clip-depth changes from reusing timeline instances (closes #50)
asimetra Apr 30, 2026
02b3066
Add mask handling for timeline objects in AnimateTimeline and SymbolT…
asimetra Apr 29, 2026
350fbae
Timelines: don't mark clipping characters as masks on flash target (c…
dimensionscape Oct 26, 2026
567f265
Solve performance issues with SWF exporter (closes #59)
m0rkeulv Sep 13, 2026
eb255c2
memory leak fix (closes #36)
Oct 17, 2025
45ab96f
Preserve lineGradientStyle in SWF shape exports
Tutez64 May 29, 2026
ba14908
Handle line gradients in SWF runtime shapes
Tutez64 May 29, 2026
2ade7d3
Fix Flash color typing for line gradients
Tutez64 May 29, 2026
0fb7488
AnimateLibraryExporter: push line gradient commands like other shape …
dimensionscape Oct 26, 2026
1a12521
Fix Haxe 3 timeline condition parsing
Tutez64 Jul 26, 2026
e851255
Optimize Animate shape command storage (closes #55)
Tutez64 Jul 25, 2026
f2ef1c3
AnimateShapeSymbolTest: compare raw draw commands, since readGraphics…
dimensionscape Oct 27, 2026
2f9f3f6
SymbolTimeline: fix compiling on flash target, where ColorTransform h…
dimensionscape Oct 27, 2026
6f05de2
Exporters: treat SymbolClass tag ID 0 as the root timeline
Tutez64 Oct 27, 2026
91cb64e
perf: cache instance fields in timelines (closes #41)
Tutez64 Mar 5, 2026
403cae8
Tools: cache generated classes for Flash/AIR libraries, and compile A…
dimensionscape Oct 27, 2026
ef7f373
AnimateLibrary: initialize generated classes from the library creatin…
dimensionscape Oct 27, 2026
5a533b0
Export linked sounds in Animate libraries (closes #45)
Tutez64 Oct 27, 2026
0617888
Tests: cover fonts, timelines, shape exports, Animate libraries and S…
dimensionscape Oct 27, 2026
fbc2c64
Tests: add tests for the command-line tools, and run them in CI
dimensionscape Oct 27, 2026
d547b80
prepare for 3.5.0
dimensionscape Oct 27, 2026
15d7385
TagDefineFont2: compare remaining bytes as Int, which Haxe 3 requires…
dimensionscape Oct 27, 2026
306025a
AnimateLibrary: find generated classes with a prefix
dimensionscape Oct 27, 2026
bb19aca
Tools: show the swf version in the command-line banner
dimensionscape Oct 27, 2026
78a4ff1
Add opt-in compact storage for Animate timelines (closes #57)
Tutez64 Oct 27, 2026
7705213
Add opt-in hardware cache for Animate bitmaps (closes #56)
Tutez64 Oct 27, 2026
ef66680
Dynamic text: cache the font found for each symbol (closes #42)
dimensionscape Oct 27, 2026
329307d
Update the 3.5.0 CHANGELOG
dimensionscape Oct 27, 2026
1658825
Declare the format dependency, and use https URLs
dimensionscape Oct 27, 2026
013cdf0
Size SWF bit fields in binary when publishing
dimensionscape Oct 27, 2026
480a9ea
Test Animate exports by loading and playing them
dimensionscape Oct 27, 2026
6ec4268
Run the tests on HTML5
dimensionscape Oct 27, 2026
2fafc95
Install format in the samples CI job
dimensionscape Oct 27, 2026
fccce54
Apply blend modes on compact Animate timelines
dimensionscape Oct 27, 2026
7b4a9bb
Fix morph shape interpolation
dimensionscape Oct 27, 2026
1c996a8
Export shape tweens in Animate libraries
dimensionscape Oct 27, 2026
b3a5245
Limit how long headless Chrome runs in CI
dimensionscape Oct 28, 2026
e53041c
Load assets without threads in HashLink CI before Haxe 4.2
dimensionscape Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 135 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
needs: package-haxelib
strategy:
matrix:
haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.6]
haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.7]
runs-on: ubuntu-latest
steps:

Expand All @@ -61,6 +61,7 @@ jobs:

- name: Install Haxe dependencies
run: |
haxelib install format --quiet
haxelib install lime --quiet
haxelib install openfl --quiet
haxelib install layout --quiet
Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:
unit-test-neko:
strategy:
matrix:
haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.6]
haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.7]
runs-on: ubuntu-latest
env:
SDL_VIDEODRIVER: "dummy"
Expand Down Expand Up @@ -126,11 +127,139 @@ jobs:
run: |
haxelib run openfl test neko

unit-test-neko-defines:
strategy:
matrix:
define: [swf_compact_animate_timelines, swf_hardware_bitmap_cache, "swf_compact_animate_timelines -Dswf_hardware_bitmap_cache"]
runs-on: ubuntu-latest
env:
SDL_VIDEODRIVER: "dummy"
SDL_AUDIODRIVER: "disk"
steps:
- uses: actions/checkout@v6

- uses: krdlab/setup-haxe@v2
with:
haxe-version: 4.3.7

- name: Set HAXEPATH
run: |
echo "HAXEPATH=$HAXE_STD_PATH/.." >> $GITHUB_ENV

- name: Install Haxe dependencies
run: |
haxelib install format --quiet
haxelib install lime --quiet
haxelib install openfl --quiet
haxelib install utest --quiet
haxelib dev swf ${{ github.workspace }}

- name: Run tests on Neko with ${{ matrix.define }}
working-directory: tests
run: |
haxelib run openfl test neko -D${{ matrix.define }}

unit-test-tools:
strategy:
matrix:
haxe-version: [4.2.5, 4.3.7]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: krdlab/setup-haxe@v2
with:
haxe-version: ${{ matrix.haxe-version }}

- name: Set HAXEPATH
run: |
echo "HAXEPATH=$HAXE_STD_PATH/.." >> $GITHUB_ENV

- name: Install Haxe dependencies
run: |
haxelib install format --quiet
haxelib install lime --quiet
haxelib install openfl --quiet
haxelib install hxp --quiet
haxelib install utest --quiet
haxelib dev swf ${{ github.workspace }}

- name: Check haxelib dependencies
run: |
haxelib path swf | grep -q -- "-D format="

- name: Rebuild swf run.n
run: |
haxe rebuild.hxml

- name: Run tools tests
working-directory: tests/tools
run: |
haxe tools.hxml
neko bin/tools.n

- name: Run tools tests with compact timelines
working-directory: tests/tools
run: |
haxe tools.hxml -D swf_compact_animate_timelines
neko bin/tools.n

unit-test-html5:
strategy:
matrix:
flags: ["", "-Dswf_compact_animate_timelines -Dswf_hardware_bitmap_cache"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: krdlab/setup-haxe@v2
with:
haxe-version: 4.3.7

- name: Set HAXEPATH
run: |
echo "HAXEPATH=$HAXE_STD_PATH/.." >> $GITHUB_ENV

- name: Install Haxe dependencies
run: |
haxelib install format --quiet
haxelib install lime --quiet
haxelib install openfl --quiet
haxelib install utest --quiet
haxelib dev swf ${{ github.workspace }}

- name: Build tests for HTML5
working-directory: tests
run: |
haxelib run openfl build html5 ${{ matrix.flags }}

- name: Run tests in headless Chrome
working-directory: tests
timeout-minutes: 8
run: |
python3 -m http.server 8000 --bind 127.0.0.1 --directory bin/html5/bin &
sleep 2
# headless Chrome sometimes hangs, so each attempt has a time limit
for attempt in 1 2 3; do
if timeout 120 google-chrome --headless=new --no-sandbox --disable-gpu --virtual-time-budget=10000 --dump-dom http://127.0.0.1:8000/index.html > report.html; then
break
fi
done
sed -e 's/<[^>]*>/ /g' report.html
grep -q "TEST OK" report.html

unit-test-hashlink:
strategy:
matrix:
# HashLink is not supported by Haxe 3
haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.6]
haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.7]
# Before Haxe 4.2, two HashLink threads reading their message queues for
# the first time can crash, so Lime loads assets without threads there
include:
- haxe-version: 4.0.5
lime-flags: -Dforce-synchronous
- haxe-version: 4.1.5
lime-flags: -Dforce-synchronous
# AL init fails on both windows and ubuntu
runs-on: macos-latest
steps:
Expand All @@ -155,12 +284,12 @@ jobs:
- name: Run tests on HashLink
working-directory: tests
run: |
haxelib run openfl test hl
haxelib run openfl test hl ${{ matrix.lime-flags }}

unit-test-air:
strategy:
matrix:
haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.6]
haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.7]
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -200,7 +329,7 @@ jobs:

- uses: krdlab/setup-haxe@v2
with:
haxe-version: "4.3.6"
haxe-version: "4.3.7"

- uses: joshtynjala/setup-adobe-air-action@v2
with:
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
3.5.0 (10/27/2026)
------------------

* Added `DisplayObject.metaData` support for Animate libraries
* Added `lineGradientStyle` support for SWF shapes in Animate, SWFLite and runtime shapes
* Added shape tween (`DefineMorphShape` and `DefineMorphShape2`) support for Animate libraries
* Added caching of generated classes for Flash and AIR SWF libraries
* Added export of linked MP3 and uncompressed sounds in Animate libraries (MP3 on native targets requires Lime 8.4 or newer)
* Added the `swf_compact_animate_timelines` define, to keep Animate timelines in compact buffers instead of one object per frame and event
* Added the `swf_hardware_bitmap_cache` define, to share Animate bitmaps and release their CPU images once uploaded
* Improved `generate="true"` on Animate libraries to compile the generated classes, so symbols are created as their linkage class
* Improved Animate shape memory usage by keeping commands compact until a shape is first drawn
* Improved SWF exporter performance for shapes with many drawing commands
* Improved timeline performance by caching instance field lists per class
* Improved dynamic text performance by caching the embedded font found for each symbol
* Changed `AnimateShapeSymbol.commands` to be `null` for shapes loaded from an Animate library
* Changed `ShapeCommand` and `AnimateShapeCommand` to include `LineGradientStyle`, so exhaustive `switch` statements over them need another case
* Changed haxelib.json to declare the `format` dependency
* Fixed Animate and SWFLite exports of SWF files without ABC or `SymbolClass` tags, such as AS2 SWF files using `ExportAssets`
* Fixed `SWFLibrary` failing to load non-embedded SWF files
* Fixed processing SWF files with linked Speex sounds
* Fixed generated Animate classes using another library's symbol when several libraries export the same class
* Fixed generated Animate classes not being used, or extending the wrong base class, when the library has a `prefix`
* Fixed the document class not being applied to the root timeline when it is not named `*_fla.MainTimeline`
* Fixed clipping characters being displayed when nothing is in their mask range
* Fixed reused timeline instances keeping an outdated `clipDepth`
* Fixed Animate `blendMode` being set to the string `"null"`
* Fixed `clippingLayer` being set on the Flash target
* Fixed SWFLite timelines failing to compile on the Flash target
* Fixed `DefineFont2` and `DefineFont3` parsing reading past the tag for fonts without layout
* Fixed `SWFRoot.publish()` sizing bit fields from the decimal digits of each value, which wrote broken matrices, rectangles, color transforms and shapes
* Fixed morph shapes moving to the origin at style changes, leaving paths open, and losing focal gradients, gradient modes and the width of filled lines
* Fixed generated Flash/AIR classes being written to the wrong package directory
* Fixed C++ compile error in `AnimateLibraryExporter` class generation
* Fixed Animate libraries created without a UUID being registered under a `null` key
* Fixed processed Animate ZIP files not being closed after writing
* Fixed the command-line tools showing the version of Lime instead of swf


3.4.0 (11/11/2025)
------------------

Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE.md) [![Haxelib Version](https://img.shields.io/github/tag/openfl/swf.svg?style=flat&label=haxelib)](http://lib.haxe.org/p/swf)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE.md) [![Haxelib Version](https://img.shields.io/github/tag/openfl/swf.svg?style=flat&label=haxelib)](https://lib.haxe.org/p/swf)

SWF
===
Expand All @@ -23,6 +23,37 @@ There are three primary code paths within the library:

This library can be called automatically by the OpenFL/Lime command-line tools to process `<library />` tags, or it can be used on the command-line to process SWF files into Animate ZIP files.

Compact Animate timelines
=========================

Projects with large Animate libraries may define
`swf_compact_animate_timelines` to keep serialized timeline events in compact
numeric buffers. The default parser creates one `AnimateFrame` and
`AnimateFrameObject` graph for every frame and event, including separate
matrix, color-transform and filter objects. The compact mode decodes these
values directly during playback, reducing retained managed memory and the
amount of graph traversal performed by full garbage collections. Filters are
rare, so they are still kept parsed.

Hardware-only Animate bitmap cache
==================================

Native hardware-rendered projects may define `swf_hardware_bitmap_cache` to
share each Animate bitmap asset between bitmap instances. After its texture is
uploaded, the decoded CPU image is released. OpenFL draws shape paths in
software, which reads the pixels of bitmap fills, so bitmaps used by shapes
keep one shared readable `BitmapData` instead.

This mode is opt-in because cached bitmap assets used by direct `Bitmap`
instances become non-readable. Pixel read/write APIs and software-renderer
fallback are not supported for those bitmaps, and their textures cannot be
restored after a graphics context is lost.

The exported Animate asset format does not change, and standard timeline
playback remains compatible. This mode is opt-in because code that accesses
`AnimateSpriteSymbol.frames` directly will not receive the eagerly expanded
legacy metadata.


Usage
=====
Expand Down
11 changes: 7 additions & 4 deletions haxelib.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "swf",
"url": "http://github.com/openfl/swf",
"url": "https://github.com/openfl/swf",
"license": "MIT",
"tags": [ "openfl", "swf", "animation", "flash", "assets", "swc" ],
"description": "Provides support for parsing and displaying SWF content",
"version": "3.4.0",
"releasenote": "Fix duplicate scale9Grid graphics, improved clipping layers, new filters",
"version": "3.5.0",
"releasenote": "Shape tweens, linked sounds, line gradients, generated class fixes, opt-in compact timelines and bitmap cache, many timeline and exporter fixes",
"contributors": [
"singmajesty",
"bowlerhat",
"Dimensionscape"
],
"classPath": "src"
"classPath": "src",
"dependencies": {
"format": ""
}
}
Loading
Loading