A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Flash is back with Ruffle emulator written in RUST

  1. #1
    Junior Member
    Join Date
    Apr 2023
    Posts
    8

    Exclamation Flash is back with Ruffle emulator written in RUST

    Works with AS2 and some AS3. You need embed code but can find that in one of my Flash posts. https://www.darkmodearts.com/blog/categories/flash

    and https://ruffle.rs/

    A direct link to the page I have embed code and playing examples here: https://www.darkmodearts.com/post/th...ction-of-flash

    Basically you can configure a server to play .wasm file type in apache or just use javascript code in the header of your page.

    <script src="https://unpkg.com/@ruffle-rs/ruffle"></script>

  2. #2
    Junior Member
    Join Date
    Apr 2023
    Posts
    8
    Not sure how to edit my post. Here is sample embed code for Ruffle. This should simply play if you replace the movie file name with your own. Should be Actionscript2 though.

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

    window.RufflePlayer.config = {
    "autoplay": "on",
    "splashScreen": "false",
    "unmuteOverlay": "hidden",
    "wmode":"transparent", // removes background color
    };

    window.addEventListener("load", (event) => {
    const ruffle = window.RufflePlayer.newest();
    const player = ruffle.createPlayer();
    const container = document.getElementById("container");
    container.appendChild(player);
    player.load("your-movie.swf");

    function resizePlayer() {
    var width = container.offsetWidth;
    var height = container.offsetHeight;
    player.style.width = width + "px";
    player.style.height = height + "px";
    }

    window.addEventListener("resize", resizePlayer);
    resizePlayer();
    });
    </script>
    <script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
    <div id="container" style="width: 100%;"></div>

  3. #3
    Junior Member
    Join Date
    Apr 2023
    Posts
    8
    For full page code to embed inside of HTML use this code:

    <html>
    <head>
    <script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
    <style>
    html, body {
    margin:0px;
    }
    </style>
    </head>
    <body>
    <script>
    window.RufflePlayer = window.RufflePlayer || {};
    //Below code forces autoplay, no splashscreen and allows sound

    window.RufflePlayer.config = {
    "autoplay": "on","splashScreen": false,"unmuteOverlay": "hidden","quality": "medium" };
    // End custom configuration code above
    window.addEventListener("load", (event) => {
    const ruffle = window.RufflePlayer.newest();
    const player = ruffle.createPlayer();
    const container = document.getElementById("container");
    container.appendChild(player);
    player.load("your-file-name.swf");
    player.style.width = "100%";
    player.style.height = "100%";
    });
    </script>
    <div id="container"></div>
    </body>
    </html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center