Peter, I am sure that it's not a bug if you say it's not, but it should be clearly documented since it runs counter to the expectations of typical OOP behavior. I read the Flex docs on object conversion back and forth several times and I find no mention there.
It is very difficult and awkward to search the Yahoo Groups archives, but I did actually search my own copy of the mailings which goes back a few months to when I joined the mailing list. I guess the discussion must have been prior to that point. . . . . ...j Peter Farland wrote: > Actually, this is not a bug and is by design as per the Flash Player's > handling of any object deserialization (LSO, AMF, etc). > > We discussed this on the list a few months ago... is it easy to search > the archives for past messages (I admit I've not done it to date). > > Pete > > > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Joe Berkovitz > Sent: Friday, May 20, 2005 1:53 PM > To: [email protected] > Subject: [flexcoders] deserialization bug: constructor runs AFTER > properties are populated > > I just found to my surprise and chagrin that when a typed AMF object is > deserialized on the client, the constructor for the object is run > *after* the object's properties have been populated from the input > stream. So if one innocently thinks that a constructor ought to be able > > to initialize various properties of the new object, well, this > initialization clobbers any deserialized values of those properties. > > Macromedia support is entering this into their bug DB, but I thought > this was worth alerting folks to. Obviously there's an easy workaround, > > which is to not do any initialization in constructors (or, if you do, > make sure that the properties actually are undefined before setting > them). > > . . . . ...j > > P.S. note that this is totally different from a prior thread that > concerned constructors with arguments. That is unsafe because the args > will be undefined at deserialization time. Here the issue is the > *timing* of the constructor call, not its argument values. > > > > > Yahoo! Groups Links > > > > > > > > > > Yahoo! Groups Links > > > > > > > > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

