I wanted to play a game made in Flash (an .SWF file) and looked for options, Ruffle has a nice demo that lets you pick the file to try but what if you just want to run it locally? The FAQ says to download the latest and gives you a one-line script which is not enough.

What other options are there? Well there is AwayFL which has an outstanding example (in the example folder after you extract the .ZIP):

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AwayFL Embed Example</title>
    <script src="../dist/embed.js"></script>
</head>
<body>
    <div id = 'container'>

    </div>

    <script>
        window.AWAY_EMBED_CFG = {}
        swfObject.embedSWF('Embedded.swf', 'container', 550, 400);
    </script>
</body>
</html>

Now we’re getting somewhere, that’s a complete .HTML plus an .SWF to boot.

  • Download AwayFL and copy its example/Embedded.swf and example/index.html files.
  • Download Ruffle (in this case 2025-05-09) and extract the .ZIP and paste our index.html and embed.swf in that folder.
  • Edit index.html to:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ruffle Embed in AwayFL Example</title>
    <script src="embed.js"></script>
</head>
<body>
    <div id = 'container'>

    </div>

    <script>
        window.RufflePlayer = window.RufflePlayer || {};

        window.addEventListener("DOMContentLoaded", () => {
            let ruffle = window.RufflePlayer.newest();
            let player = ruffle.createPlayer();
            let container = document.getElementById("container");
            container.appendChild(player);
            player.ruffle().load("Embedded.swf");
        });
    </script>
    <script src="ruffle.js"></script>
</body>

It will give you an error when you open the index.html in your browser, you need to serve it which is easily done if you have Python with python -m http.server, it will host the current directory at http://0.0.0.0:8000/ and, if you open it, you should now see Ruffle loading up then a Play button and finally a circle and a square.

I later made a video on this, watch it here.

PS: If you’d rather you can also use AwayFL directly by running python -m http.server on its folder and opening http://0.0.0.0:8000/example on a browser. For some reason it shows two circles.