Director FAQ [14] Objects, Parent Scripts & Factories [14.9] How are factories different from parents, and is there any reason to use them instead?
Factories are the way objects were implemented in previous versions of Director. They continue to be available in Director 4 to maintain backwards compatibility. If you use Director 3.1.3 or earlier you obviously have no alternative but to use factories, but for users of Director 4 there is no reason to use them, and parents offer the advantage of automatic disposal. Also, some people have reported that factories’ memory management can be unreliable. In short, ditch those factories now! The syntax for factories is somewhat different, but their functionality is very similar to parent scripts, so it may be useful to read the previous sections for some background. I’m afraid this is gonna be pretty cursory.
Related Questions
- Director FAQ [14] Objects, Parent Scripts & Factories [14.7] I want to put objects on the stage on the fly. How do I allocate channels?
- Director FAQ [14] Objects, Parent Scripts & Factories [14.10] Do I need to dispose of these objects when Im done?
- Director FAQ [14] Objects, Parent Scripts & Factories [14.6] Do objects always relate to sprites?