views:

86

answers:

3

I am using ExtrernalInterface.call(javascript_function, args); to call javascript functions from Flex. But this fails in case of browsers that have javascript disabled.

Is there any other way to call javascript functions from flex?

+4  A: 

If JavaScript is disabled in the browser then there is no way to invoke it from Flex. In fact, if you were to find a way it would be a security hole.

James Keesey
+1  A: 

Unfortunately, no. ExternalInterface is the only way to communicate with JavaScript.

What do you mean, in browse, javascript are disable

Gabriel McAdams
@Gabriel: Thanks for updating.
Ravi K Chowdary
+3  A: 

Prior to AS3, fscommand was used to call javascript functions from flash. But no matter what method you use to call javascript, it won't work if the user has disabled javascript in the browser. Because javascript has been disabled in that browser to begin with.

Amarghosh
@Amarghosh: Thanks for updating. I had this question from Adobe. I said same asnwer.But they are asking any other way is called from flex to javascript. as per my knowledge, there is no other way. If have please update me once again. Thanks
Ravi K Chowdary
@Amarghosh: just curious, what if you have a browser window inside your flex app? is that still limited by client browser settings? Seems like it would be, but I could see how it might not.
invertedSpear
@invertedSpear Can you have a browser window inside a Flex app? There is an HTML control but that's AIR only (haven't tried it yet, so don't know if it supports javascript or not - after all, a desktop application's external interface is not the browser).
Amarghosh
My answer to this question has links for putting a browser in an iframe within the Flex app. Not sure on how it all ties in to the clients browser (if its totally in flex, or flex has a window with the clients browser in it). http://stackoverflow.com/questions/1879808/create-a-webbrowser-in-flex/1882230#1882230
invertedSpear