Director FAQ [14] Objects, Parent Scripts & Factories [14.6] Do objects always relate to sprites?
No. As discussed above, objects are just a collection of code and data. They are not sprites. Sprites are sprites. Objects can be used for anything you want to use them for. Sprite control is one common use, but anything that needs multiple instances of some class of thing, or needs to keep data that knows how to manipulate itself (eg. abstract data types like stacks or trees) can be done using objects.
Related Questions
- Director FAQ [14] Objects, Parent Scripts & Factories [14.9] How are factories different from parents, and is there any reason to use them instead?
- 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?