# Simple OOP best practice questions

**URL:** <https://forum.kirupa.com/t/simple-oop-best-practice-questions/300570>\
**Category:** flash\
**Created:** [November 23, 2009, 9:36pm UTC](https://forum.kirupa.com/t/simple-oop-best-practice-questions/300570 "2009-11-23T21:36:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![albino](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/albino/32/1022_2.png) [@albino](https://forum.kirupa.com/u/albino)\
**Post date:** [November 23, 2009, 9:36pm UTC](https://forum.kirupa.com/t/simple-oop-best-practice-questions/300570/1 "2009-11-23T21:36:42Z")

</div>

Hi,

I’d consider myself fairly competent at flash, and I understand most principles regarding OOP, but I am still having a little trouble merging it all together. I have 2 simple (I hope) questions:

1. How do you feel about keeping ALL code in external classes? I have managed it so far, but I’ve got to the point where I want to make a navigation bar, and it’d be a lot easier if I made each button, stored it in the library, and then loaded them. Would this still be considered best practice?

2. I need to make resize controls for certain elements when clicked on. What would be the best way to go about this? I was thinking of making a resize class, which my elements would then extend. The class would include an onClick event which should then show the resize controls (added as a child?) and then resize the parent. However, this means that all these elements need to be a custom class, so that I can extend the resize class. Anyway to add the class to all Sprites, for instance?

Cheers 🙂
