简体   繁体   English

在AS3按钮按下时,将变量从AS2 swf传递到AS3 swf有哪些选项?

[英]What are the options for passing variables from AS2 swf to AS3 swf on AS3 button press?

I have 2 swfs, one image loader which I built a while ago and will eventually update to AS3 and a newer swf I built in AS3. 我有2个swfs,我刚刚建立的一个图像加载器,最终将更新到AS3和我在AS3中构建的更新的swf。 I want to be able to 'pull' a variable from the AS2 swf when a button on the AS3 swf is pressed. 我希望能够在按下AS3 swf上的按钮时从AS2 swf中“拉出”变量。 How might i be able to do this. 我怎么能这样做。 LocalConnection wont do it I dont think - i cant load the AS2 swf into the AS3 swf and obviously cant do the reverse though this would be the way to do it if it were possible. LocalConnection不会这样做我不认为 - 我不能将AS2 swf加载到AS3 swf中,显然不能反过来尽管如果可能的话,这将是这样做的方法。

So when a button in the AS3 swf is pressed I want to call the AS2 swf and return a variable from the AS2 swf (the filename of the current image). 因此,当按下AS3 swf中的按钮时,我想调用AS2 swf并从AS2 swf返回一个变量(当前图像的文件名)。 Would both swfs sharing ExternalInterface work? swfs共享ExternalInterface是否有效?

any suggestions? 有什么建议么?

You can use LocalConnection . 您可以使用LocalConnection Or better yet: Use SWFBridge 或者更好:使用SWFBridge

As noted above, LocalConnection may not be the most reliable: http://bugs.adobe.com/jira/browse/FP-371 如上所述,LocalConnection可能不是最可靠的: http : //bugs.adobe.com/jira/browse/FP-371

An alternative would be to do a combination of fscommand() and ExternalInterface via JavaScript. 另一种方法是通过JavaScript组合fscommand()ExternalInterface

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM