开发者

Flash and javascript communication without ExternalInterface

开发者 https://www.devze.com 2022-12-13 21:20 出处:网络
How Can I send data out from flash to开发者_开发技巧 javascript without ExternalInterfaceYou can use fscommand(). But why do you not want to use ExternalInterface in the first place?There are a number

How Can I send data out from flash to开发者_开发技巧 javascript without ExternalInterface


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


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...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号