I'm having a similar problem with a subclass of Dictionary. Unfortunately I haven't has an opportunity to try this fix yet, but maybe you'll find it useful: http://stackoverflow.com/questions/850466/properly-serializing-flash-utils-dictionary-to-a-sharedobject
--- In [email protected], "Geoffrey" <geoff...@...> wrote: > > > > Muzak, thank you for your help. However, I have already tried [RemoteClass] > (which I mentioned in the original post). I also looked at the link that you > provided and decided to try more combinations, but none worked. I have tried > [RemoteClass] with and w/o [Bindable], [RemoteClass(alias="ByteArrayPlus")], > and I made sure to use my class beforehand. In all cases I can get a custom > class to retain its type, but ByteArrayPlus always gets read as ByteArray > from the SharedObject. > > I believe this may be a problem peculiar to ByteArray, but I don't know > exactly why that would be so. > > Again, the challenge is this: make any class that extends ByteArray, write it > to a SharedObject (to the disk), read it from the SharedObject, and have it > retain its class. I know it sounds straightforward, but I cannot get it to > work. > > --Geoff > > --- In [email protected], "Muzak" <p.ginneberge@> wrote: > > > > Add a RemoteClass metadata tag to the custom class: > > > > Example at the bottom of the article > > http://cookbooks.adobe.com/post_How_to_keep_the_type_of_your_objects_when_serializ-8323.html > > > > > > ----- Original Message ----- > > From: "Geoffrey" <geoffhom@> > > To: <[email protected]> > > Sent: Wednesday, October 28, 2009 12:45 PM > > Subject: [flexcoders] SharedObject problem/bug? Cannot store a subclass of > > ByteArray. > > > > > > > Hi, > > > > > > I have a subclass of ByteArray (let's call it ByteArrayPlus), which I > > > want to write to a SharedObject. I can store it fine, but > > > when I read it back, it says it's of type ByteArray, not ByteArrayPlus. > > > Does anyone have an idea what may be wrong? Has anyone > > > gotten this to work? > > > > > > FYI, I am already using registerClassAlias(). And it works fine with a > > > custom class, and with a custom class extending another > > > custom class. I also tried implementing IExternalizable, but that did not > > > help. I also tried [RemoteClass] and > > > [RemoteClass(alias="ByteArrayPlus")]. > > > > > > Also, ByteArrayPlus is really simple: I only added a String (name) to it. > > > > > > This is my first post to FlexCoders. > > > > > > Any help appreciated. > > > > > > --Geoff > > > > > >

