The real fun is just getting started, building classes needs more concentration before you start. As I had mentioned in my last post, we were trying to build a special DropDownMenu for our needs in the application, and what I thought initially was that I will be able to use the Scrollbar we had built into the drop down menu and that's all.
But when I was building the drop down menu, I suddenly understood another class to be used inside our menu, though I named the new class ItemList Class! So, now we should first build an ItemList class which its job would be to create the necessary boxes for our items which later will be placed under the Scrollbar and the Scrollbar will the go under the menu.
But again, I thought again and found out that we again need another class named Box so it will first create us the boxes with information in it and then we can insert the boxes to the ItemList and then put the ItemList under the Scrollbar and finally the Scrollbar under the drop down menu!!!
I was building the Box class that I suddenly understood that again we need another class inside of it!!! OOHHHH
HaHaHa
Don't get crazy, that how it is, it's inevitable, that's just how it is, we needed a ExternalLoader class which could load any given external file in it.
Let me tell you something, we may had created your drop down menu without breaking it into smaller classes, but that's totally a wrong idea because you will in any case have to write some algorithms so why you shouldn't do them all in separated classes which each one will do only its work independently?
How we have divided our menu class into a lot of smaller classes is a very good idea because you may somewhere else need to use that ItemList to list some objects without using it under a menu and now that it's built in a class you will be able to do that.
So it's always a good idea to create as many classes as you can, do the classes and break them down to create new classes, do it until you really come to a point that there's no more need to cut a class to any smaller pieces. That's when you are really writing classes with respect to OOP
OK, today I will post two new classes, the ExternalLoader and the Box class... Keep checking back...
Regards,
Hadi

My Flash Lab