swf2js.js is a JavaScript FlashPlayer emulator that analyzes SWF files of Adobe Animate (Flash) in real time and converts them to HTML.
swf2js.min.js is the minified version created with [Google Closure Compiler)(https://developers.google.com/closure/compiler).
This version is an adaption based on swf2js.js version 0.7.8 from https://github.com/swf2js/swf2js.com/blob/master/assets/js/swf2js.js
Added support for sounds and soundstreams
Warning : no support for Actionscript 3.
For the source see https://github.com/music4classicalguitar/swf2js.
See https://github.com/swf2js/swf2js and https://swf2js.com/en/ for a commercial version that supports Actionscript 3.
<script type="text/javascript" src="swf2js.js"></script> <script type="text/javascript"> swf2js.load('SET SWF PATH'); </script>
Option | Description | Additional information |
---|---|---|
tagId | Place swf-player in element with tag 'tagId' | |
width | Set width of swf-player | |
height | Set height of swf-player | |
callback | Function to be called when swf-player has loaded the swf-file | |
FlashVars | ||
quality | Values : "low", use devicePixelRatio*0.5 or "high", use devicePixelRatio | See devicePixelRatio |
bgcolor | Set background color |
Example usage of options.
<div id="swf_1" style="width: 320px; height: 320px;"></div> <div id="swf_2" style="width: 320px; height: 320px;"></div> <script type="text/javascript" src="swf2js.js"></script> <script type="text/javascript"> swf2js.load('analog20.swf', {tagId: "swf_1", width: 320, height}); swf2js.load('mogura.swf', {tagId: "swf_2"}); </script>
See also https://swf2js.com/en/#skills for the differences between the free and the commercial version.
SWF FILE FORMAT SPECIFICATION VERSION 19
https://www.adobe.com/content/dam/acom/en/devnet/pdf/swf-file-format-spec.pdf