简体   繁体   English

承载AS2 SWF的AS3 SWF如何共享同一阵列?

[英]How can an AS3 swf hosting an AS2 swf share the same array?

I have an AS2 swf that has an array that is updated when a user clicks on items on the screen. 我有一个AS2 SWF,它的数组在用户单击屏幕上的项目时会更新。 The array stores the currently selected items. 数组存储当前选定的项目。 This As2 swf is hosted by an AS3 swf loaded in using Loader class and a local connection between them is managed by swfBridge. 该As2 swf由使用Loader类加载的AS3 swf托管,它们之间的本地连接由swfBridge管理。

I want to know what the best way for both AS3 and AS2 swfs to share this array is? 我想知道AS3和AS2 SWF共享此阵列的最佳方法是什么? or how can I call a function in the AS2 (client) swf and return the array to the AS3 (host) swf when it needs to read the items from the array? 还是在需要从数组中读取项目时如何在AS2(客户端)swf中调用函数并将数组返回到AS3(主机)swf?

you can use local connection, and grant skinner created swfBridge specifically for this purpose: 您可以使用本地连接,并专门为此目的授予skinner创建的swfBridge:

http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html

if you run into any quarks with working with the arrays, I remember strange things like the length being a value in it when doing a for each loop... just a heads up. 如果您在处理数组时遇到了夸夸其谈,我会记住一些奇怪的事情,例如在为每个循环执行a时,其中的长度就是其中的一个值。

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

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