战略决策的LocalConnection IDS独特 [英] Strategy for making LocalConnection ids unique

查看:165
本文介绍了战略决策的LocalConnection IDS独特的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用一个LocalConnection以允许ActionScript 2的SWF和一个ActionScript 3 SWF之间的通信。
LocalConnection对象共享跨越用户的PC一个全局命名空间。 因此,这意味着,用户可以启动我的Flash应用程序在一个浏览器,并提交命令,反反复复,这正是我想要的。但用户也可以启动其他浏览器,并将其发送到我的应用程序的所有命令将被首先应用程序来处理,如果它在第一个浏览器仍然加载。 对于我而言,这是非常糟糕的。 当我做出的LocalConnection,我指定一个ID,但ID必须是已知的ActionScript 2的主权财富基金,并在其中我发现一个问题。我不知道如何让ActionScript 2的主权财富基金的了解独有的ID​​是什么。 任何想法,以什么可以做的?

I'm using a localconnection to allow communication between an actionscript 2 swf and an actionscript 3 swf.
Localconnection objects share a global namespace across a user's pc. So, this means, a user can fire up my flash app in one browser, and submit commands, back and forth, which is what i want. But the user can also fire up another browser, and all commands sent to my application will be handled by the first application if its still loaded in the first browser. For my purposes, this is very bad. When I make the LocalConnection, I specify an id, but the id must be known to the actionscript 2 swfs, and therein I find a problem. I don't know how to let the actionscript 2 swfs know what the unique id is. Any ideas as to what could be done?

推荐答案

嵌入两个主权财富基金时,穿越Flash变量的ID。你可以做到这一点的服务器端或客户端的JavaScript。你可以用户时间戳或随机号码,作为唯一的ID由双方的swf共享

Pass the id through flashvars when embedding both swfs. You can do this server-side or client-side with Javascript. You could user a timestamp or a random number to act as the unique id shared by both swfs.

这篇关于战略决策的LocalConnection IDS独特的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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