Skip to content
SwfLib a C# library for parsing swf files into Document Object Model.
C# Other
  1. C# 98.9%
  2. Other 1.1%
Branch: master
Clone or download
Pull request Compare This branch is even with SavchukSergey:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
References/swfmill
SwfLib.Avm2
SwfLib.SwfMill.Tests
SwfLib.SwfMill
SwfLib.Tests.Asserts
SwfLib.Tests
SwfLib
artifacts
docs
.gitignore
LICENSE
README.md
SwfLib.sln
codeanalysis.ruleset
omnisharp.json

README.md

SwfLib

SwfLib a C# library for parsing swf files into Document Object Model.

After parsing you can access individual tags, modify their properties and save whole swf file.

It supports ActionScript 2.0.

ActionScript 3.0. is planned.

Usage examples:

using (var source = File.Open("source.swf", FileMode.Open, FileAccess.Read)) {
    var swf = SwfFile.ReadFrom(source);
    swf.Tags.Add(new SetBackgroundColorTag { Color = new SwfRGB(10, 224, 224) });
    using (var target = File.Open("target.swf", FileMode.Create, FileAccess.ReadWrite)) {
        swf.WriteTo(target);
        target.Flush();
    }
}

#SwfLibMill

SwfLibMill is a console application that use swfmill format to represent content of flash file as xml document.

Swf file can be converted to xml file, changed and converted to swf file.

Example

<?xml version="1.0"?>
<swf version="8" compressed="0">
  <Header framerate="20" frames="1">
    <size>
      <Rectangle left="0" right="100" top="0" bottom="100"/>
    </size>
    <tags>
      <FileAttributes hasMetaData="0" allowABC="0" suppressCrossDomainCaching="0" swfRelativeURLs="0" useNetwork="1" useDirectBlit="0" useGPU="0"/>
      <SetBackgroundColor>
        <color>
          <Color red="10" green="224" blue="224"/>
        </color>
      </SetBackgroundColor>
      <ShowFrame/>
      <End/>
    </tags>
  </Header>
</swf>
You can’t perform that action at this time.