Content

  • Background
  • Basic usage
  • Options
  • Examples
  • Known problems
  • Information
  • Background

    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.

    Basic usage

    <script type="text/javascript" src="swf2js.js"></script>
    <script type="text/javascript">
        swf2js.load('SET SWF PATH');
    </script>  
    		

    Options

    OptionDescriptionAdditional information
    tagIdPlace swf-player in element with tag 'tagId'
    widthSet width of swf-player
    heightSet height of swf-player
    callbackFunction to be called when swf-player has loaded the swf-file
    FlashVars
    qualityValues : "low", use devicePixelRatio*0.5 or "high", use devicePixelRatioSee devicePixelRatio
    bgcolorSet 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 example_options.html

    Examples

    Examples

    Animated music

    Known problems

    See also https://swf2js.com/en/#skills for the differences between the free and the commercial version.

    Information

    SWF FILE FORMAT SPECIFICATION VERSION 19
    https://www.adobe.com/content/dam/acom/en/devnet/pdf/swf-file-format-spec.pdf