0

I have a javascript for example

try { __flash__toXML(onYouTubePlayerReady("")) ; } catch (e) { "<undefined/>"; } .

In FireFox, Adobe plugin(Flash player plugin) executes above Java Script by calling NPN_Evaluate and NPN_Evaluate() returns result also.

I am not getting how in IE, adobe flash player(ActiveX) executes the above and same JAVA script. But I am seeing a result in SetReturnValue() of IShockwaveFlash like </undefined>, <string>3456</string>. It looks like Adobe ActiveX is not using IHTMLWindow2::execScript() to execute JS.

I would like to know how to execute the JS code from ActiveX.

I know how to call a JS function with the help of IHTMLWindow2::execScript(). But IHTMLWindow2::execScript() does not returns result. Also I know How to call a JS function with the help of IDispatch() interfaces.

I would like to know how Adobe ActiveX is executing the above code. I am also developing a similar ActiveX for IE and I would like to execute similar kind of JS(above one) from ActiveX.

ronalchn
  • 12,225
  • 10
  • 51
  • 61

3 Answers3

1

ActiveX uses IE's IHTMLWindow2::execScript() to execute javascript, but IHTMLWindow2::execScript() do not return result. It uses IshockwaveFlash::SetRerernValue and IShockwaveFlash::CallFunction to return javascript result.

wyx
  • 59
  • 1
  • 7
0

To the best of my knowledge, there is no way to do what you're asking to do; at least if there is it is fairly new and only works on newer versions of IE (I haven't looked hard recently). One option, however, is to wrap the script in a function call and save the result of that call to some global variable (on window) that you can then query to get the return value.

I don't know for sure, but I would guess that this is something along the lines of what flash is doing.

taxilian
  • 14,229
  • 4
  • 34
  • 73
0

Although I do agree SWFObject is the best method, you can pass the values through the 'src' and 'movie' params. EX:

'src', '/resources/flash/corporateWebsitButtons?variable=value&variable2=value'
'movie', '/resources/flash/corporateWebsitButtons?variable=value&variable2=value'
kukido
  • 10,431
  • 1
  • 45
  • 52