> >> Might be interesting to know why you need to do this at all. > >> > > > > I'm using an XML document to create a file. Without going into > > details, each node of the XML is to be turned into an > object, based on the kind of node. > > So for example: > > > > <xml><item type='Big' size='3' /><item type='Small' size='2'></xml> > > > > This would become two objects, one an instance of > MyBigClass, one an > > instance of MySmallClass. In an old version of this, each one was a > > MovieClip with the appropriate linkage name. Now I'm trying > to do it > > more flexibly with objects (so that in particular, each object type > > can inherit a standard class, and so that I don't have to have a > > separate movieClip for each object type). > > > > Danny > > > > > Why would you not have 1 class with 2 properties "type" and "size"? > What is different between the 2 items that requires different > classes? > The properties are the same. What does Big do that Small does not do?
Loads of things (remember, 'big' and 'small' are just examples here). They're completely different objects. For example, one might refer to a bit of text, another to a picture, etc. If I put it all into one class, I'd have to fill it with Ifs and Switchs, which is what I'm trying to avoid. (Btw, I was out of communication yesterday due to a break-in at our office, so apologies to those people who sent replies that I didn't respond to) Best Danny _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com