Giter VIP home page Giter VIP logo

swf2js's Introduction

swf2js.js

swf2js.js is a JavaScript FlashPlayer emulator that analyzes SWF files of Adobe Animate (Flash) in real time and converts them to HTML.

Content

Background

Basic usage

Options

Examples

Known problems

Information

This version of swf2js is an adaption based on swf2js.js version 0.7.8 from https://github.com/swf2js/swf2js.com/blob/master/assets/js/swf2js.js

swf2js.min.js is the minified version created with [Google Closure Compiler)(https://developers.google.com/closure/compiler).

Added support for sounds and soundstreams

  • Sounds : mp3, raw (wave), ADPCM, NellyMoser.
  • Soundstreams : mp3, raw (wave), ADPCM.

Warning : no support for Actionscript 3 which is introduced in Flash Player 9 (initially called 8.5).

Newer swf-files (version 9 and up) will probably still work, if you didn't useActionscript 3

If you have (or can find) Flash MX 2004 or Flash (Professional) 8, you can stil create sfw-files and use them with swf2js.js

Licenses for Adobe Flash can be found on https://helpx.adobe.com/en/x-productkb/policy-pricing/macromedia-legacy-activation-error.html

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.min.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.

function informMe(arg) {  alert("informMe : swf-file loaded"); }

swf2js.load('tiger.swf', {tagId: "swf_instance", width: "320", height: "320", callback : informMe, bgcolor: "black"});

See example_options.html

Examples

Animated music

  • More than one swf-file in a page does not work properly.
  • Obviously Adobe FlashPlayer knows the exact frame size, even if bigger than the specified framesize in the header.
    See examples : mogura and PlayPauseStop5
  • Video (mp4 and flv) not supported.

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

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

This gives information on the internal format of swf-files, but no information how Adobe FlashPlayer uses (was using) it to display the content.

swf2js's People

Contributors

gitter-badger avatar humbertodias avatar ienaga avatar music4classicalguitar avatar ousia avatar thomas-sonicmoov avatar vikbez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.