我正在尝试在它加载的 as3 swf 和 as2 swf 之间共享数据。问题是,我似乎无法让我的 as2 swf 读取由 as3 swf 写入的 localshared 对象。当我尝试获取对共享对象的引用时,它只是返回 undefined
// AS3
_SharedObj.objectEncoding = ObjectEncoding.AMF0;
_SharedObj.data.blah = 'str';
_SharedObj.flush(500);
// ... some code to handle the flush status. I verified that the values were flushed.
// AS2
var so = SharedObject.getLocal('somestr', '/');
trace(so); // undefined!
我在这里不知所措。我可以从 AS3 读取 AS2 共享对象,但不能以其他方式读取。我已经验证两者都引用了相同的路径'/'(特别是localhost,我什至检查了文件系统中的物理文件, - 它在我的mac上#SharedObjects目录的#localhost目录中)objectEncoding设置为使用AS2 AMF 格式。
文档特别说设置此编码以允许 as2 访问相同的共享对象,所以我认为这意味着这是可能的。
有人有想法么?