开发者

How to read all data from abstract Shared Object file? (Flash, Actionscript)

开发者 https://www.devze.com 2023-01-02 20:20 出处:网络
what I meen is to get all objects and their properties, is it possible? How to do such thing?开发者_开发问答

what I meen is to get all objects and their properties, is it possible? How to do such thing?开发者_开发问答


  1. Read the SharedObject. The documentation is a great start.
  2. Loop through the properties. Depending on how you stored them if they are simple, a for...in loop should do it. If you are storing complex types (like an Object inside and Object, etc.), you need to first check if the object is simple or not. If it is not, you need to loop through its properties.

Luckily, since you've tagged this for flex as well, the ObjectUtils class will be handy for things like checking if an Object isSimple() or inspecting an Object's properties via getClassInfo().

e.g.
//assuming nestedObjectFromSO is a nested object read from a SharedObject
trace(ObjectUtil.getClassInfo(nestedObjectFromSO).properties);

Depending on your structure, you might need to write a recursive function that gets the data from nested objects within your SharedObject.

HTH, George


You can use AIR Shared Object Editor to grab and edit .sol files.

0

精彩评论

暂无评论...
验证码 换一张
取 消