I have a requirement to dynamically add flash elements into a page and have FSCommand function properly.
FSCommand is the primary method that Flash gives a programmer to execute scripts within the parent browser.
This requires some shim code to be added as a listener. This listens for script calls from Flash.
Sub flashBufferingPlayer_FSCommand(ByVal command, ByVal args)
call flashBufferingPlayer_DoFSCommand(command, args)
So at first glance it seems that the listener must be VBScript.
- Adding script via innerHTML does not work. Testcase.
- Using document.createElement appendChild does not work.
- Using document.write creates a new document.
<SCRIPT event=FSCommand(command,args) for=flashBufferingPlayer>
And doubly lucky, a script event listener will work when dynamically added using innerHTML.
Sadly it seems that nothing like
flashBufferingPlayer.onfscommand = flashBufferingPlayer_DoFSCommand;