0

I dont have acsesses to the code on ruffle.js and when i try ti use other metheits it says extension blocked but ruffle has worked on this computer and anyone help? "My" code rn is:

<!DOCTYPE HTML>
<html>
    <head>
        <meta charset='utf8'>
    </head>
    <body>
        <div id='ruffle'></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.load("movie.swf");
    });
</script>
<script src="https://flash-games.penguinbotcoder.repl.co/ruffle/ruffle.js"></script>
<object width="600" height="400">
    <param name="movie" value="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
    <embed src="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
    </embed>
</object>
<script src="path/to/ruffle/ruffle.js"></script>
    </body>
    <div class=ruffle>
    </div>
    <p>This is a test page for flash content</p>
</html>

as i sayed up there its just not working :(

General Grievance
  • 4,555
  • 31
  • 31
  • 45
  • See if the update solves your problem. If yes, then please mark the Answer as correct (click the grey ✓ icon). This lets other people know there is a working solution in this post. – VC.One Jan 27 '23 at 13:53

1 Answers1

1

I don't understand well what is exactly the problem but this is what I noticed from you code: You are trying to get an element by id container but you don't have that element in your HTML, I think you try to use the element with id ruffle instead.

window.addEventListener("DOMContentLoaded", () => {
    let ruffle = window.RufflePlayer.newest();

    let player = ruffle.createPlayer();
    let container = document.getElementById("ruffle");
    container.appendChild(player);
player.load("movie.swf");
});

Update:
If still not working then try this example code and see if it loads the Flash content...

<!DOCTYPE HTML>
<html>
    <head> <meta charset='utf8'> </head>
    
    <body>
    
        <script src="https://flash-games.penguinbotcoder.repl.co/ruffle/ruffle.js"></script>
    
        <div id='ruffle'></div>
        
        <p>This is a test page for Adobe Flash content</p>
        
    </body>
    
    <script>
    
        window.RufflePlayer = window.RufflePlayer || {};
        window.addEventListener("DOMContentLoaded", start_Ruffle, false );
        
        function start_Ruffle()
        {
            let ruffle = window.RufflePlayer.newest();
            let player = ruffle.createPlayer();
            let container = document.getElementById("ruffle");
            container.appendChild(player);
            player.load("https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf");
            
        }
        
    </script>

</html>
VC.One
  • 14,790
  • 4
  • 25
  • 57
amel
  • 1,098
  • 2
  • 4
  • 17
  • 1
    I hope you don't mind the edit. You were closest to a correct answer (yes, it was accessing the wrong Div) so I'll just update your post instead of adding yet another Answer that has basically the same logic. – VC.One Jan 27 '23 at 00:38