Danny, > >It works, but seems fundamentally wrong, as I understood it was bad > >practise > to add methods to an object dynamically. Should I make the > class listen for clicks on the nested clip or is there > another solution? > > There's nothing wrong with adding methods to an object > dynamically. What's slightly dodgy is 'talking to' a child or > property of an object directly. > It's better OO practice for the object to be in charge of its > own properties, and to talk to it by some kind of accessor > method. So you might say
The original post and your reply, raised a question in my mind. I got my start in programming with languages like Basic, Pascal, and C (no, not C++ or C#). I latched onto Hypercard and Supercard in the beginning of the 90s. (Yeah, I'm showing my age.) Later, as the web moved into the commercial sector, I got into JavaScript, followed by Director and Flash. I brought with me a lot of line-by-line coding bad habits. As much as I understand OOP and try to utilize OOP in my projects, I often relapse into "scripting" mode simply because it is natural to me. Would you -- or anyone else out there -- have a good self-study book, web site, online course, or other general recommendation, for breaking me out of my existing mind set? It's got to be straightforward enough so that I grasp it, but not so easy that I get bored by "Hello World" exercises (eg, Sam's "Teach Yourself in 24 Hrs"), or so didactic that my intelligence is insulted (eg, "_____ for Dummies"). My first thought was to jump into Java or some other environment that will inhibit my ability to fall off the OOP wagon, so I picked up the books "Head First Java" and "Head First Design Patterns" and am just starting to devour them. Thoughts? Suggestions? FWIW, I did pick up the book ...Rob _______________________________________________ [email protected] 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

