检索共享对象时 Flash/Flex 错误 #1063
我有一个基于 Flex 3 构建的零件应用程序,但零件列表有问题。 零件列表使用两个对象:
- 零件
- ArrayOfPart
I 将零件列表本地缓存在 SharedObject 中。 这几个月以来一直运行良好。 我向 Part 类添加了一个新的布尔属性,并重新导入了 Web 服务(这应该不会影响任何内容),现在,我可以很好地保存 ArrayOfPart SharedObject,但是当我尝试检索 SharedObject 时,我得到了“ArgumentError:错误 #1063:ArrayOfPart 上的参数计数不匹配。预期为 1,实际为 0。然后它完全删除了我的 SOL 文件。
(我在 Part 和 ArrayOfPart 上使用了 RegisterClass,因此它们都可以序列化为SharedObjects)
以下是我遇到错误时所遵循的步骤:
保存共享对象:
so = SharedObject.getLocal("PartsList");
so.data.AllParts = AllParts;
so.flush();
验证 SharedObject:
- SharedObject PartsList.sol 存在于我应该
- 打开 SharedObject 文件的位置,并且 ArrayOfPart 数据看起来有效
重新启动应用程序,它会从 SharedObject 中检索部件列表。这是引发错误 #1063 的行。导致sol文件被删除:
so = SharedObject.getLocal("PartsList");
看起来数据保存在SharedObject中时格式可能不正确? 这可能吗?
I have a parts application that is built on Flex 3 and I having a problem with the parts list. The parts list uses two objects:
- Part
- ArrayOfPart
I cache the parts list locally in a SharedObject. This has been working fine for a couple months. I added a new Boolean property to the Part class and re-imported web services (which shouldn't have affected anything) and now, I can save the ArrayOfPart SharedObject fine, but when I try to retrieve the SharedObject, I get "ArgumentError: Error #1063: Argument count mismatch on ArrayOfPart. Expected 1, got 0. AND then it DELETES my SOL file completely.
(I used RegisterClass on Part and ArrayOfPart, so they both are serializable to SharedObjects)
Here's the steps I followed to get the error:
Save the shared object:
so = SharedObject.getLocal("PartsList");
so.data.AllParts = AllParts;
so.flush();
Verify the SharedObject:
- The SharedObject PartsList.sol exists where it should
- I opened the SharedObject file and the ArrayOfPart data looks valid
Restart the application and it retrieves the parts list from the SharedObject. This is the line that throws the Error #1063 and causes the sol file to be deleted:
so = SharedObject.getLocal("PartsList");
It looks like the data may not be well-formed when it's saved in the SharedObject? Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我解决了我自己的问题。
ArrayOfPart 有一个带有参数的构造函数。 当我删除构造函数时,错误就消失了。
顺便说一句,这是 Flash 9。
I solved my own problem.
The ArrayOfPart had a constructor with a parameter. When I removed the constructor, the error went away.
By the way, this was Flash 9.
这看起来很难。
我不认为这是一个形成或序列化问题。 也许您的代码中的其他内容正在写入共享对象?
有什么办法可以分享一下你的源码吗? 这会有所帮助,因为我个人没有足够的信息来诊断正在发生的情况而看不到代码的其余部分:(
另外....
还有其他东西正在写入或更改此共享对象吗
?我的对象是在 AS3 中创建的,或者是在 MXML 中创建的(我注意到 Flex 编译器并不总是能很好地识别 MXML)。
?
如果是 Flash 10,在 Flash 9 中也会出现同样的问题吗 ?
是否在所有浏览器和所有平台上都会发生这种情况
This looks like a tough one.
I don't think it is a formation or serialization issue. Maybe something else in your code is writing to the shared object?
Is there any way you can share your source? This would help as I personally don't have enough info to diagnose what is going on w/o seeing the rest of the code :(
Also....
Is there anything else that is writing to or changing this shared object?
Are all my objects created in AS3 or are some in MXML (I have noticed that the Flex compiler does not always do a good job figuring out MXML).
What version of Flash do I have?
If its Flash 10 does the same problem occur in Flash 9?
Does this happen in all browsers and on all platforms?
只是预感,但是,自从我安装了 Flash Player 10 以来,我在浏览时看到了许多共享对象错误。 是否与新引入的沙箱/安全限制有关?
Just a hunch, but, since I installed Flash Player 10, I am seeing lots of errors with Shared Objects when browsing. Could it be related to newly introduced sandbox/security restrictions?