Google App Engine 上的 Flash ExternalInterface 问题 [英] Problem with Flash ExternalInterface on Google App Engine

查看:32
本文介绍了Google App Engine 上的 Flash ExternalInterface 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几个小时我一直在为此苦苦挣扎,我真的不知道哪里出了问题.我只是想让 Javascript 与 Flash 通信文本.我在这个来源中找到了这个很好的例子

I've been struggling with this for the past couple hours now and I really don't know what could be wrong. I'm simply trying to get Javascript to communicate text with Flash. I found this great example with this source

http://blog.circlecube.com/wp-content/uploads/2008/02/ActionscriptJavascriptCommunication.zip

我在本地运行了 html 文件,它可以很好地从 Flash 发送和检索文本.然后我将完全相同的样本加载到我的开发谷歌应用服务器中,但我无法将文本从 javascript 发送到 Flash.奇怪的是,虽然 flash 能够发送 Javascript 文本.有人可以看看他们是否可以使用 GAE 运行此程序吗?感谢一百万!

I ran the html file locally and it works just fine sending and retrieving text from flash. Then I load that same exact sample into my dev google app server and I can't send the text from javascript to flash. Oddly enough though flash is able to send Javascript text. Can anybody see if they can get this running with GAE? Thanks a million!

推荐答案

我在您的代码中没有看到对 allowDomain 函数的调用.否则,安全沙箱将不允许您的 Flash 应用程序与服务器上的 Flash 进行通信,反之亦然.为 Flash 应用程序将在其上执行的每个域添加对 System.security.allowDomain("mydomain.com", "mySecondDomain.com", "etc.com") 的调用.此外,嵌入代码还需要通过包含参数 <param name="allowScriptAccess" value="always"/> 来指定对 JavaScript 的访问.

I do not see a call to the allowDomain function in your code. With out that the security sandbox will not allow your flash application to communicate with flash and vice versa on the server. Add a call to System.security.allowDomain("mydomain.com", "mySecondDomain.com", "etc.com") for every domain the flash app will be executed on. Also the embed code also needs to specify access for JavaScript by including the parameter <param name="allowScriptAccess" value="always" />.

这篇关于Google App Engine 上的 Flash ExternalInterface 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆