i'm usin flash builder create actionscript code uses sharedobjects. first question: how can delete local sharedobject in flash builder? debugging program , sharedobject sems persist between runs. want start fresh , clean no sharedobject storing data. how rid of it?
also, in sharedobject, used mysharedobject.data["mykey"] store dictionary. dictionary have string keys , values of mycustomclass. problem when later try loop on values of dictionary, error #1034 cannot convert object type mycustomclass. seems can put item of type mycustomclass dictionary, can't item out other object.
any idea going wrong?
those 2 questions, should have been asked 2 questions. anyway, i'd answer them here still prefer break them in 2 parts (possibly leave link other 1 here reference sake):
local shared object, useful persistence across runs. , there's sharedobject.clear() clear state required.
for second issue, shared object's serialize object amf, can written disk or sent on network using rtmp. now, custom class can't serialized in amf. happens public properties (and dynamic ones, if class declared dynamic) serialized structure. so, public data stored... it's general object. work around that, can have
public static readfrom(object:object):mycustomclasstype function, read properties passed object construct
new mycustomclassrepresenting information.
there ways register class player stored in sharedobject (see here)... need make sure code de-serializes data aware of class well.
Comments
Post a Comment