Flash fscommands and javascript

I am trying to get mp3 flash player to work with my javascript in all browsers. At first everything went well, but quickly realized that my code did not work on MSIE.

After it turned out, I found this in the reference code:

<!--[if IE]>
<script type="text/javascript" event="FSCommand(command,args)" for="myFlash">
eval(args);
</script>
<![endif]-->

How to turn this into a javascript or jquery sentence that I could write where it belongs (in audio.js)?

+3
source share
4 answers

<script> "event" "for" - Internet Explorer DOM. FSCommand myFlash. , , Flash, JavaScript . Flash FSCommand, JavaScript .

JS FlashVars . FSCommands ActionScript -, . , IE JS- , FSCommand Flash-, . , ID Flash, .

+2

, -.

, mp3-. , IE script "event" "for", . IE jquery.html(), , document.write. document.write , iframe - .

, IE bastard script . , :

<script type="text/javascript" event="FSCommand(command,args)" for="myFlash">
    eval(args);
</script>

IE :

function foo(command, args){
    eval(args);
}
var ie_sucks = document.getElementById('myFlash');
ie_sucks.attachEvent("FSCommand", foo);
+1

... :

var ie_sucks = document.getElementById('comebacker_audio');
ie_sucks.attachEvent("FSCommand", function(command, args) {eval(args);});

, html . : http://kb2.adobe.com/cps/415/tn_4150.html

;)

+1

. , .

To reuse the code in a browser, follow these steps:

<script type="text/javascript">
    function mySwf_DoFSCommand(command, args) {
        // do stuff
    }
</script>

<!--[if IE]>
<script type="text/javascript" event="FSCommand(command,args)" for="mySwf">
    mySwf_DoFSCommand(command, args);
</script>
<![endif]-->
0
source

Source: https://habr.com/ru/post/1699406/


All Articles