Adobe Flash (AKA Shockwave Flash, Macromedia Flash) format spec for Kaitai Struct (2024)

SWF files are used by Adobe Flash (AKA Shockwave Flash, MacromediaFlash) to encode rich interactive multimedia content and are,essentially, a container for special bytecode instructions to playback that content. In early 2000s, it was dominant rich multimediaweb format (.swf files were integrated into web pages and playedback with a browser plugin), but its usage largely declined in2010s, as HTML5 and performant browser-native solutions(i.e. JavaScript engines and graphical approaches, such as WebGL)emerged.

There are a lot of versions of SWF (~36), format is somewhatdocumented by Adobe.

File extension

swf

KS implementation details

License: CC0-1.0

References

This page hosts a formal specification of Adobe Flash (AKA Shockwave Flash, Macromedia Flash) using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

  • Overview
  • C++11/STL
  • C++98/STL
  • C#
  • Go
  • GraphViz
  • Java
  • JavaScript
  • Lua
  • Nim
  • Perl
  • PHP
  • Python
  • Ruby

Block diagram

Format specification in Kaitai Struct YAML

meta: id: swf title: Adobe Flash (AKA Shockwave Flash, Macromedia Flash) file-extension: swf xref: justsolve: SWF pronom: fmt/507 # - fmt/{505..507} # Adobe Flash {8..10} # - fmt/{757..776} # Adobe Flash {11..30} loc: - fdd000130 # SWF 7 - fdd000248 # SWF 8 mime: application/x-shockwave-flash wikidata: Q594447 tags: - executable - media license: CC0-1.0 endian: le# imports:# - abc_bytecodedoc: | SWF files are used by Adobe Flash (AKA Shockwave Flash, Macromedia Flash) to encode rich interactive multimedia content and are, essentially, a container for special bytecode instructions to play back that content. In early 2000s, it was dominant rich multimedia web format (.swf files were integrated into web pages and played back with a browser plugin), but its usage largely declined in 2010s, as HTML5 and performant browser-native solutions (i.e. JavaScript engines and graphical approaches, such as WebGL) emerged. There are a lot of versions of SWF (~36), format is somewhat documented by Adobe.doc-ref: https://open-flash.github.io/mirrors/swf-spec-19.pdfseq: - id: compression -orig-id: Signature type: u1 enum: compressions - id: signature -orig-id: Signature contents: "WS" - id: version -orig-id: Version type: u1 - id: len_file -orig-id: FileLength type: u4 - id: plain_body size-eos: true type: swf_body if: compression == compressions::none - id: zlib_body size-eos: true process: zlib type: swf_body if: compression == compressions::zlibtypes: swf_body: seq: - id: rect type: rect - id: frame_rate type: u2 - id: frame_count type: u2 - id: file_attributes_tag type: tag if: _root.version >= 8 - id: tags type: tag repeat: eos rect: seq: - id: b1 type: u1 - id: skip size: num_bytes instances: num_bits: value: b1 >> 3 num_bytes: value: ((num_bits * 4 - 3) + 7) / 8 rgb: seq: - id: r type: u1 - id: g type: u1 - id: b type: u1 tag: seq: - id: record_header type: record_header - id: tag_body size: record_header.len type: switch-on: record_header.tag_type cases: 'tag_type::define_sound': define_sound_body 'tag_type::do_abc': do_abc_body 'tag_type::script_limits': script_limits_body 'tag_type::symbol_class': symbol_class_body 'tag_type::set_background_color': rgb 'tag_type::export_assets': symbol_class_body define_sound_body: seq: - id: id -orig-id: SoundId type: u2 - id: format -orig-id: SoundFormat type: b4 - id: sampling_rate -orig-id: SoundRate type: b2 enum: sampling_rates doc: Sound sampling rate, as per enum. Ignored for Nellymoser and Speex codecs. - id: bits_per_sample -orig-id: SoundSize type: b1 enum: bps - id: num_channels -orig-id: SoundType type: b1 enum: channels - id: num_samples type: u4 enums: sampling_rates: 0: rate_5_5_khz 1: rate_11_khz 2: rate_22_khz 3: rate_44_khz bps: 0: sound_8_bit 1: sound_16_bit channels: 0: mono 1: stereo do_abc_body: seq: - id: flags type: u4 - id: name type: strz encoding: ASCII - id: abcdata size-eos: true #type: abc_bytecode script_limits_body: seq: - id: max_recursion_depth type: u2 - id: script_timeout_seconds type: u2 symbol_class_body: seq: - id: num_symbols type: u2 - id: symbols type: symbol repeat: expr repeat-expr: num_symbols types: symbol: seq: - id: tag type: u2 - id: name type: strz encoding: ASCII record_header: seq: - id: tag_code_and_length type: u2 - id: big_len type: s4 if: small_len == 0x3f instances: tag_type: value: 'tag_code_and_length >> 6' enum: tag_type small_len: value: 'tag_code_and_length & 0b111111' len: value: 'small_len == 0x3f ? big_len : small_len'enums: compressions: 0x46: none # F 0x43: zlib # C 0x5a: lzma # Z tag_type: 0: end_of_file 4: place_object 5: remove_object 9: set_background_color 14: define_sound 26: place_object2 28: remove_object2 43: frame_label 56: export_assets 65: script_limits 69: file_attributes 70: place_object3 76: symbol_class 77: metadata 78: define_scaling_grid 82: do_abc 86: define_scene_and_frame_label_data
Adobe Flash (AKA Shockwave Flash, Macromedia Flash) format spec for Kaitai Struct (2024)

FAQs

What is the Shockwave file format? ›

SWF, or Small Web Format, is an Adobe Flash File format that contains text, vector and raster graphics, and ActionScript. Sometimes, it can also be referred to as a "Shockwave Flash File." Videos and audios can also be included in an SWF format to compress them and make sharing easier.

Is Adobe Flash and Macromedia Flash different? ›

Adobe Flash (formerly Macromedia Flash and FutureSplash) is a discontinued multimedia software platform used for production of animations, rich internet applications, desktop applications, mobile apps, mobile games, and embedded web browser video players.

What is Adobe Flash file format? ›

SWF
Filename extension.swf
Magic numberCWS , FWS or ZWS
Developed byFutureWave Software, later taken over by Macromedia and Adobe Systems
Type of formatVector graphic animation
Container forAdobe Flash (formerly Macromedia Flash and FutureSplash), sometimes labeled Shockwave Flash Object.
2 more rows

Is Adobe Shockwave the same as Flash Player? ›

Flash Player plays web content created using Flash Professional, Flex, or Flash Builder (ActionScript programming language). Adobe Shockwave Player plays web content that has been created using Adobe Director.

What is the difference between a flash file and a shockwave file? ›

FLA and SWF are two file formats that are utilized by Adobe Flash software. FLA is the file type used to store the editable source file for a Flash animation project, whereas SWF is the file format used to deliver the animation's final result, which can be played in a Flash player or web browser.

How do I convert Shockwave files? ›

How to convert SWF on Windows or Mac with Movavi
  1. Install the converter on your computer. Download the SWF converter for Mac or Windows and run the installation file. ...
  2. Add files you want to convert. Launch the program. ...
  3. Set the output format. ...
  4. Edit the clip (optional) ...
  5. Convert your files.
Jun 5, 2024

Does anyone use Adobe Flash anymore? ›

No, there isn't any. Flash is dead. And Flash player has been EOL since end of 2020. That's more than a year ago.

Why did Adobe Flash shut down? ›

Security was a big factor in the death of Adobe Flash Player. On repeated occasions, the plug-in was hacked and Adobe had to publish updates and patches to fix the issues this created. However, HTML 5 had better security standards, which ensured people's information was kept private whilst online.

What has replaced Macromedia Flash? ›

Adobe Animate (formerly Adobe Flash Professional, Macromedia Flash, and FutureSplash Animator) is a multimedia authoring and computer animation program developed by Adobe.

How do I open a Shockwave Flash file? ›

How To Open An SWF File In A Browser
  1. Instal the plugin. To open an SWF file on any web browser, you can first download the Flash Player plugin from Adobe. ...
  2. Enable Flash on the browser. To play SWF files after installing the plugin, enable Flash on your browser by going into the settings and looking for Flash options.
Sep 12, 2023

What is the data format of a wave file? ›

The WAVE file format, being a subset of Microsoft's RIFF specification, starts with a file header followed by a sequence of data chunks. A WAVE file has a single “WAVE” chunk which consists of two sub-chunks: a “fmt” chunk - specifies the data format. a “data” chunk - contains the actual sample data.

What is the difference between WAV and WV files? ›

These WavPack compressed audio files have 30 to 70 percent of the original file size. WV supports hybrid audio compression. These compressed files are relatively small in size, higher in quality, and can be used in the same format (i.e no conversion needed to open and use ).

What are Shockwave Flash files known also as? ›

An SWF file is a type of animated movie file. Pronounced “swiff,” SWF is short for Shockwave Flash movie (though it is also sometimes called Small Web Format).

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Greg O'Connell

Last Updated:

Views: 5946

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Greg O'Connell

Birthday: 1992-01-10

Address: Suite 517 2436 Jefferey Pass, Shanitaside, UT 27519

Phone: +2614651609714

Job: Education Developer

Hobby: Cooking, Gambling, Pottery, Shooting, Baseball, Singing, Snowboarding

Introduction: My name is Greg O'Connell, I am a delightful, colorful, talented, kind, lively, modern, tender person who loves writing and wants to share my knowledge and understanding with you.