When I started this blog nearly 15 years ago, Flash was at its peak and much of the content on this blog was related to Flash. Since the Flash player no longer exists, a lot of content had either been lost or old posts completely busted. There was even still some video embeds using old Flash embed codes. Although outdated, I never liked that this historical content had essentially been lost to the sands of time and always wanted to preserve old pages for archival reasons.

Recently I discovered Ruffle. Ruffle is a Flash Player emultor written in Rust that plays SWF files in the browser via WebAssembly. Using Ruffle, I have been able to restore Flash embeds in older posts, bringing some life back into the archives. I have been quite surprised at how well the library works. Even things like external files and PixelBender shaders are working. There are however several things I’ve found that don’t work very well. Things such as text input, filter effects and 3D DisplayObject properties either don’t work at all, or are buggy. Ruffle is being actively developed so hopefully over time the features will improve. I thought a lot of this stuff would never be seen again so it’s pretty cool to see it working.

Converting SWFObject to Ruffle

Switching the SWFObject embeds to Ruffle was a really simple process. Using some custom HTML, I can embed the SWFs again using the following code. I just take the URL from the old Flash <object> embed and replace it here:

<!-- include the Ruffle lib -->
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>

<!-- create a placeholder div -->
<div id="swfembed"></div>

<!-- create a Ruffle player, add to the div, load the SWF -->
<script>
    window.RufflePlayer = window.RufflePlayer || {};
    window.addEventListener("load", (event) => {
        const ruffle = window.RufflePlayer.newest();
        const player = ruffle.createPlayer();
        const container = document.getElementById("swfembed");
        container.appendChild(player);
        player.load("path/to/flashfile.swf");
    });
</script>

And here is an example of one of my embedded SWFs:

One important thing to note is that the SWF should be hosted on the same domain, otherwise you’ll likely run into crossdomain issues since Flash didn’t support proper CORS.

Throughout the process I’ve rediscovered things I had completely forgotten about. Some could even still be useful today if they were converted from ActionScript. Here are a few examples:

Updating old video embeds

As mentioned earlier there was also a number of posts that used old Flash embed codes from YouTube and Vimeo. Some others were still using HTTP instead of HTTPS and so were failing. I’ve updated these to restore the videos where they still exist on the services.

Here’s an interesting video that I had forgotten about: Actuating Widgets on Interactive Tabletops