Paintapp includes a built-in SWF player that can open and play back .swf files
directly in the canvas without any browser plugin. The player is a custom JavaScript
implementation of the Flash runtime, covering the display list, ActionScript VMs, and
several video codecs.
SWF files carry a version byte in their header (SWF 1 through SWF 43 covers the full commercial lifetime of Flash). Paintapp reads all versions — the version byte controls which ActionScript VM is used at runtime:
| SWF version | Flash Player equivalent | ActionScript VM |
|---|---|---|
| 1 – 8 | Flash Player 1 – 8 | AVM1 (ActionScript 1 & 2) |
| 9 – 43 | Flash Player 9 – 32 | AVM2 (ActionScript 3) |
SWF 9 and later files may also contain embedded AVM1 clips (DoAction tags).
These are executed by the AVM1 sub-interpreter running alongside AVM2.
A .swf file may be stored uncompressed or compressed in one of two ways.
Paintapp opens all three.
| Compression | Used by |
|---|---|
| Uncompressed | SWF 1 and later |
| Deflate (zlib) | SWF 6 and later — the most common |
| LZMA | SWF 13 and later — published for Flash Player 11+ |
LZMA-compressed movies usually end up smaller than deflate-compressed ones.
AVM1 is a stack-based interpreter that executes bytecode from DoAction and
DoInitAction tags. The implementation covers 89 opcodes including arithmetic,
string operations, object property access, function calls, and control flow.
| Feature | Status |
|---|---|
| Core opcode set (89 opcodes) | Supported |
Function definitions (DefineFunction, DefineFunction2) | Supported |
with blocks | Supported |
| Try / catch (partial) | Partial |
| Variable scope chain | Partial |
GetURL / loadMovie | Limited |
SetTarget path navigation | Not supported |
AVM2 is a fully-featured bytecode VM with an explicit call stack, proper scope chains,
exception handling, and namespace-aware multiname resolution. ABC (ActionScript Byte Code)
blocks from DoABC / DoABCDefine tags are parsed into a constant
pool, method table, and class hierarchy, then executed by the interpreter.
| VM feature | Status |
|---|---|
| ABC bytecode interpreter | Supported |
| Class definitions, inheritance, static members | Supported |
| Instance variables / slots, getters & setters | Supported |
| Closures / nested functions | Supported |
| Exceptions (throw / try / catch / finally) | Supported |
Type coercions (coerce, convert_*) | Supported |
is / instanceof | Supported |
| Namespaces / multinames | Partial |
| Interfaces | Partial |
for-in / for-each-in | Partial |
Vector.<T> | Not supported |
| Debugger breakpoints (step-into / step-over) | Supported |
Workers (flash.system.Worker) | Supported |
The following flash.* packages are implemented, fully or partially. The
ActionScript 3 API page lists every class and member.
| Package | Coverage |
|---|---|
flash.display | DisplayList, MovieClip, Sprite, Shape, Bitmap, Stage, Loader — mostly supported; some child-order and Stage focus APIs missing |
flash.events | EventDispatcher, Event, MouseEvent, broadcast events (enterFrame, addedToStage) — supported; KeyboardEvent, FocusEvent, TimerEvent not yet implemented |
flash.geom | Point, Rectangle, Matrix and ColorTransform are complete; Transform is partial; 3D geometry (Vector3D, Matrix3D) not implemented |
flash.utils | ByteArray, Dictionary, Endian, setTimeout/setInterval/getTimer — supported; Timer class and AMF not implemented |
flash.net | URLLoader reads files stored beside the .swf; NetStream plays nothing, and SharedObject, Socket and the rest are not implemented |
flash.system | Security, Capabilities, Worker, WorkerDomain — supported |
flash.media | Video on the timeline plays, but its ActionScript attach methods throw; Sound and camera classes not implemented |
flash.filters | BlurFilter (partial); other filters not implemented |
flash.external | ExternalInterface reports no container is available; addCallback and call are no-ops |
flash.errors | Standard error classes — supported |
flash.crypto | generateRandomBytes — supported |
AVM2 globals — Math, Array, String, Number,
Boolean, int, uint, RegExp — are backed
directly by JavaScript built-ins and are fully supported.
Date and XML (E4X) are partially supported.
Vector.<T> is not yet implemented.
A SWF body is a flat stream of tags, each with a type number and a length. The player walks
the whole stream — including the tag lists nested inside DefineSprite — and
hands every tag it recognizes to a parser. A tag it does not recognize is stepped over by its
own length and playback continues, so an unsupported tag never aborts a file.
The table covers every tag the SWF specification defines.
Supported and
Partial mark what the player parses.
Ignored means the tag is dropped and nothing is lost by
dropping it — text hinting hints, authoring-time flags such as Protect and the
debugger tags, numbers no tool emits any more.
Unsupported is a real gap: something in the file does
not reach the screen or the speakers, and the Notes column says what.
File Info reports what several of these tags say about the file — protection, debugging,
imports — from a separate header scan, whether or not the player uses them. Tag numbers
missing from the table are Macromedia Generator leftovers or were never assigned; no Flash
authoring tool emits them.
| Tag | Name | Status | Notes |
|---|---|---|---|
| 1 | ShowFrame | Supported | Frame boundary — drives the timeline. |
| 2 | DefineShape | Supported | Fills, strokes, edge records. |
| 3 | FreeCharacter | Ignored | Obsolete SWF 1 tag; no Flash authoring tool emits it. |
| 4 | PlaceObject | Supported | Matrix and color transform. |
| 5 | RemoveObject | Supported | Removes by character id + depth. |
| 6 | DefineBits | Supported | JPEG image that borrows its tables from JPEGTables. |
| 7 | DefineButton | Supported | Up / over / down / hit states plus the action list. |
| 8 | JPEGTables | Supported | Shared JPEG tables for DefineBits. |
| 9 | SetBackgroundColor | Supported | Stage background. |
| 10 | DefineFont | Supported | Glyph outlines. |
| 11 | DefineText | Supported | Static text records. |
| 12 | DoAction | Partial | AVM1 frame script — see the ActionScript 1 / 2 table above. |
| 13 | DefineFontInfo | Supported | Character-code map for a DefineFont. |
| 14 | DefineSound | Partial | Parsed for every codec; only MP3 is decoded for playback. |
| 15 | StartSound | Partial | One event sound is played; volume envelopes are ignored. |
| 17 | DefineButtonSound | Unsupported | Buttons make no sound. |
| 18 | SoundStreamHead | Partial | MP3 streams only. |
| 19 | SoundStreamBlock | Partial | Blocks are concatenated into one MP3 stream. |
| 20 | DefineBitsLossless | Supported | 8-, 15- and 24-bit zlib bitmaps. |
| 21 | DefineBitsJPEG2 | Supported | JPEG, PNG or single-frame GIF payload. |
| 22 | DefineShape2 | Supported | Larger style tables. |
| 23 | DefineButtonCxform | Unsupported | The per-state color transform of a v1 button is not applied. |
| 24 | Protect | Ignored | An authoring-time editing lock, optionally carrying a password hash. It asks authoring tools, not players, to prompt for it — Flash Player never enforced it either, and Paintapp opens protected files without asking. Reported in File Info. |
| 26 | PlaceObject2 | Supported | Matrix, color transform, ratio, clip depth, instance name, clip actions. |
| 28 | RemoveObject2 | Supported | Removes by depth. |
| 32 | DefineShape3 | Supported | RGBA fills and strokes. |
| 33 | DefineText2 | Supported | Static text with alpha. |
| 34 | DefineButton2 | Supported | State records with color transforms and filters, plus condition actions. |
| 35 | DefineBitsJPEG3 | Supported | Image plus a zlib-compressed alpha plane. |
| 36 | DefineBitsLossless2 | Supported | Lossless bitmap with alpha. |
| 37 | DefineEditText | Partial | The field's initial text is drawn as static text. Not editable or selectable; HTML markup, borders and scrolling are ignored. |
| 39 | DefineSprite | Supported | Nested timelines, parsed recursively. |
| 41 | ProductInfo | Supported | Undocumented Adobe tag — authoring tool and build date, shown in File Info. |
| 43 | FrameLabel | Supported | Label names; the named-anchor flag is skipped. |
| 45 | SoundStreamHead2 | Partial | Same path as SoundStreamHead. |
| 46 | DefineMorphShape | Supported | Start and end shapes interpolated by the placement ratio. |
| 48 | DefineFont2 | Supported | Glyphs, code table and advances; bounds and kerning tables are skipped. |
| 56 | ExportAssets | Supported | Export names recorded on the document. |
| 57 | ImportAssets | Unsupported | Assets imported from another SWF are missing. Counted in File Info. |
| 58 | EnableDebugger | Ignored | Authoring-time debug password; nothing to play back. Reported in File Info. |
| 59 | DoInitAction | Unsupported | A sprite's AVM1 initialization script does not run. Counted in File Info. |
| 60 | DefineVideoStream | Supported | Stream geometry and codec id. |
| 61 | VideoFrame | Supported | Decoded by codec — see Video Codecs. |
| 62 | DefineFontInfo2 | Supported | Code map with a language code. |
| 63 | DebugID | Ignored | Undocumented debug GUID left by the compiler. |
| 64 | EnableDebugger2 | Ignored | As EnableDebugger, SWF 6 and later. |
| 65 | ScriptLimits | Supported | The movie's own recursion cap and script timeout are applied to both VMs. |
| 66 | SetTabIndex | Unsupported | Tab order is not implemented. |
| 69 | FileAttributes | Supported | Selects AVM1 or AVM2; network and metadata flags read. |
| 70 | PlaceObject3 | Supported | Adds class name, blend mode, filter list, cacheAsBitmap and visibility. Filters themselves are partial. |
| 71 | ImportAssets2 | Unsupported | As ImportAssets, SWF 8 and later. |
| 72 | DoABC (unnamed) | Supported | The SWF 9 form without flags or a name. |
| 73 | DefineFontAlignZones | Ignored | ClearType hinting zones — the renderer does not hint glyphs. |
| 74 | CSMTextSettings | Ignored | ClearType anti-aliasing settings for a text field. |
| 75 | DefineFont3 | Supported | High-resolution glyph coordinates. |
| 76 | SymbolClass | Supported | Binds characters to AS3 classes, including the document class. |
| 77 | Metadata | Supported | The XMP packet is kept and shown in File Info. |
| 78 | DefineScalingGrid | Unsupported | A scaled sprite or button stretches as a whole instead of keeping its 9-slice corners at their authored size. |
| 82 | DoABC | Supported | Named, lazily-initialized ABC block. |
| 83 | DefineShape4 | Supported | Stroke joins, caps and scaling flags read. |
| 84 | DefineMorphShape2 | Supported | As DefineMorphShape, with the extended stroke fields. |
| 86 | DefineSceneAndFrameLabelData | Partial | Scene names are read for File Info; the player itself uses only the scene count, and scene navigation is not implemented. |
| 87 | DefineBinaryData | Supported | Stored in the character dictionary, reachable from AS3 through SymbolClass. |
| 88 | DefineFontName | Supported | The font's full name and copyright string, recorded on the font character alongside the short name from DefineFont2 / 3 / 4. |
| 89 | StartSound2 | Partial | Parsed, but a sound referenced by class name is not played. |
| 90 | DefineBitsJPEG4 | Supported | Image plus alpha plane; the deblocking parameter is ignored. |
| 91 | DefineFont4 | Supported | The embedded CFF / OpenType font is parsed. |
| 93 | EnableTelemetry | Ignored | Adobe Scout profiler opt-in and password hash. |
| 94 | PlaceObject4 | Unsupported | An object placed with this tag never appears. Emitted by very few authoring tools. |
SWF video streams and embedded FLV content use Flash-specific codecs decoded in JavaScript:
| Codec | Used in | Status |
|---|---|---|
| Sorenson H.263 | SWF video streams, FLV | Supported |
| Screen Video (v1 & v2) | SWF video streams, FLV | Supported |
| On2 VP6 / VP6 with alpha | FLV | Not supported |
| H.264 / AAC in FLV | FLV | Not supported (browser Media Source used instead) |
The SWF display list is rendered into Paintapp's WebGL 2 canvas. Shapes are tessellated and uploaded as GPU geometry; bitmaps are uploaded as textures. Rendering features:
Sound / SoundChannel / SoundMixer
are not implemented. SWF files that rely heavily on ActionScript audio APIs will be silent.
Inline stream sound (SoundStreamBlock) has partial support.
DoInitAction (tag 59) is not
executed, so AVM1 content that sets its symbols up through init clips may start in an
unfinished state.
DefineButtonSound (tag 17) is not decoded;
buttons are silent.
KeyboardEvent is not implemented.
Interactive SWF content that requires keyboard navigation will not respond to key presses.
DefineText are displayed correctly.
SharedObject, Socket, and AMF-encoded
NetConnection calls are not implemented.
SetTarget path navigation
in AVM1 have known gaps that may affect older Flash 4–5 content.
flash.geom.Vector3D, Matrix3D, and
PerspectiveProjection are not implemented. Molehill / Stage3D is not supported.