viewhack

Play an old Flash .swf file in your browser

Drop a .swf game, cartoon, e-learning module or ad banner. First you see what it is: the Flash version it was made for, its stage size, frame rate and length, whether it is ActionScript 1/2 or 3, and its fonts, sounds, video and the web addresses inside it. Then press Play and it runs here, in the Ruffle Flash emulator. No Flash Player, no extension, no download to install.

The file is read by this tab on your device and is not uploaded. While it plays, its networking is switched off: it cannot load anything, call a server or open a link.

What it shows

Reading a Flash file

A worked example
One of Ruffle’s own test files, sound_embeddedprops, is 8,450 bytes. Its first bytes are CWS and 2B: zlib-compressed, SWF version 43, which is Flash Player 32, the last one Adobe shipped. Unpacked it is 10,367 bytes: a 550 × 400 px stage at 24 fps with a single frame, ActionScript 3 with the document class test_fla.MainTimeline, and two embedded MP3 sounds of 46,080 samples at 44.1 kHz mono, 1.045 seconds each. A one-frame movie is normal for ActionScript 3: the code, not the timeline, decides how long it runs.
SWF version to Flash Player
SWF 1 to 10 match Flash Player 1 to 10 (SWF 10 covers 10.0 and 10.1). After that each SWF version is a minor release: 11 is 10.2, 12 is 10.3, 13 is 11.0, 14 to 22 are 11.1 to 11.9, 23 is 12, and 24 to 43 are 13 to 32. SWF 44 and later were written for Adobe AIR and Harman AIR 33 onwards.
Compression
FWS files are stored as is. CWS (Flash Player 6, 2002, onwards) packs everything after the first 8 bytes with zlib, which is how most files you will find are saved. ZWS (Flash Player 11, 2011, onwards) uses LZMA instead and is rarer. The header’s length field is always the unpacked size.
ActionScript 1/2 or 3
ActionScript 1 and 2 (Flash 5 to Flash 8, roughly 2000 to 2006, plus many later games that kept using them) run on the first ActionScript virtual machine, AVM1. ActionScript 3 (Flash Player 9, 2006, onwards) is a different language on a different virtual machine, AVM2. Ruffle’s AVM1 support is close to complete; its AVM2 support covers a large and growing share of games but not all of Flash’s ActionScript 3 library.
Ruffle
The player is Ruffle 0.6.0, an open-source Flash Player emulator written in Rust and compiled to WebAssembly (MIT or Apache-2.0 licence). It is served from this site, not from a CDN: 0.5 MB of JavaScript, then about 14 MB of WebAssembly the first time you press Play. The file’s facts above the player are read by viewhack’s own SWF reader, which needs neither.
Tested on
Movies generated in the test (uncompressed, zlib and LZMA; ActionScript 1/2 and 3; with fonts, sounds, a video stream, buttons, movie clips and URLs in every place the reader looks), and three files from Ruffle’s own test collection: an ActionScript 1 getURL test, an ActionScript 3 movie with two MP3 sounds, and a VP6 video that draws a TV test card. In a headless browser each plays after the click, and no request leaves the site after the file is dropped.

What this cannot do

Other ways to play a .swf

On your computer
Ruffle’s desktop app for Windows, macOS and Linux opens a .swf from disk and can be allowed network access, for movies that need it. Flashpoint Archive is a preservation project that collects Flash games and animations together with the players they need.
Looking inside
JPEXS Free Flash Decompiler exports a .swf’s scripts, shapes, sounds, fonts and frames, and can convert frames to images.