Ultrashock Forums > Blogs > Whirled Views
OOP is more than just a double-entendre
Member Blogs
 
Join me for a different perspective on Flash/Actionscript programming: a perspective saturated with hyperbole and couched in precocious vernacular.
With diligent perseverance and a little luck, this blog could become the center of a radical new view of the web.
'Course I'd settle for entertaining and/or insightful.

Welcome to my Whirled View!
Bookmark and Share!
Rate this Entry

OOP is more than just a double-entendre

Posted 2 Weeks Ago at 14:23 by jaseinatl
Here is the perfect example of how I have become completely paralyzed by options:

To start, I want to create a basic AS2 framework that will enable me to create a simple menu/content system that does the following:

click a menu item, load it's content.

Wow, sounds simple, right? Well, lets add some more details:

When a menu item is clicked, it should change appearance and function because it represents the current active content.

splinter 1 - maybe it should have an indicator of whether the content is already loaded
splinter 2 - perhaps it should have a loading indicator (instead of just loaded/not loaded)
splinter 3 - perhaps it should have a visited indicator that shows whether you have seen this content
splinter 4 - perhaps an indicator for new content that lets you know that visited pages have new content?
splinter 5 - can this be setup as an RSS/ATOM feed

-----------------------------------------backup

On my Stage,
I want a MovieClip that holds all of the content movieClips: contentHolder
I want a MovieClip that holds all of the menuitem movieClips: menuHolder

inside the menuHolder movieClip, i will have several movieClips that contain both a label (label_txt) and button (btn):menuClip
each menuClip will have a controller attribute that references the menuHolder (a little redundant since _parent exists, but maybe necessary for polym);
each menuClip will capture the button's mouse events and react to the onRelease event by alerting it's controller

the menuHolder object will then tell the contentHolder object to load the appropriate content when it receives notice from any of its buttons.

The contentHolder checks to see if the content is already loaded based on the data passed by the menuHolder.
If it is, it then tells the current content to hide and the new content to show itself
When the new content is active, the contentHolder tells the menuHolder to update its menuItem that corresponds to the current loaded content.

sounds good? Well, I set this up a dozen different ways and finally realized that there were some redundant processes going on:

the act of toggling the state of an item within in a group happens on both the menuHolder and the contentHolder.
In fact, the contentHolder and menuHolder are extremely similar if you make the showClip and hideClip functions modular.

So, I threw out all my work and started writing a class that would control groups of similar elements.

But then I thought: maybe I should be writing element-level classes that act as groups.

Then I thought: This is driving me crazy, I'm gonna start all over and not lose my focus this time.

Meanwhile the website is no further along, I have lost more hair and feel even less competent than when I started.
 
Recent Blog Entries by jaseinatl