views:

95

answers:

3

How Can I send data out from flash to javascript without ExternalInterface

+1  A: 

You can use fscommand(). But why do you not want to use ExternalInterface in the first place?

Amarghosh
+1  A: 

There are a number of tricks you can use to avoid ExternalInterface although I need to agree with Amarghosh - why not use ExternalInterface.

The tricks you could try are:

  • Navigate to a javascript: URL. In AS2 you used to be able to getURL("javascript:myFunction()") - I haven't used the trick in as3 but I guess something like navigateToUrl(new URLRequest('javascript:myFunction()')); might work.
  • (this is a really old one that we used to use back in Flash 4 days) load a page into an iframe, possibly passing GET parameters and have this page communicate with the hosting page via JS

Both of these may or may not work reliably in different browsers. ExternalInterface is much more reliable and flexible so I'm really interested to know why you are avoiding it...

vitch
A: 

I dont have wrapper around my swf (i am accessing swf directly) and I want to access javascript function which is in html page. The same html is embeded in swf using IFRAME. Can I do that?

flex_spark