I have the code below when I execute it in html file it still works but when I apply it in my reactjs project it doesn’t seem to work getting the message “You need to enable JavaScript to run this app.” On the network, it seems I need to configure something in webpack to read the swf file. I use Craco to configure my project.
<script type="text/javascript" src="./swf2js/swf2js.js"></script>
<script type="text/javascript">
swf2js.load("./file/634088_mad_ben_v2.swf", {
id: "swfContainer",
width: 800,
height: 600,
callback: function(instance) {
console.log('SWF file loaded successfully!');
console.log('instance',instance);
},
onError: function() {
console.error('Error loading SWF file.');
}
});
</script>
I expected the file to load