I have an AS2 swf that has an array that is updated when a user clicks on items on the screen. 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,它有一个数组,当用户点击屏幕上的项目时会更新该数组。该数组存储当前选定的项目。这个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? 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?
我想知道AS3和AS2 swfs分享这个数组的最佳方法是什么?或者我如何调用AS2(客户端)swf中的函数并在需要从数组中读取项目时将数组返回到AS3(主机)swf?
1 个解决方案
#1
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
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.
如果你遇到任何使用数组的夸克,我会记得奇怪的事情,比如长度是为每个循环做一个值的时候......只是一个抬头。
#1
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
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.
如果你遇到任何使用数组的夸克,我会记得奇怪的事情,比如长度是为每个循环做一个值的时候......只是一个抬头。