Tater Salad

You can chop em up, mash em up, or boil em in a stew.

!super

Posted by caseyrayl on October 27, 2007

I recently spent a good deal of time debugging an issue that one of our Flex apps was having with TileList extensions. Eventually I worked it all the way down to the collectionChangeHandler in TileBase. The handler was setting the horizontal scroll position regardless of whether or not the direction of the TileList made it appropriate. On a side note, I also found out later that this bug is now fixed in FB3 Beta2.

Anyway, my problem with this bug was the available options to fix it. My first and most obvious attempt to resolve it was to override the collectionChangeHandeler in my extensions. Unfortunately this failed due to the fact that the code in TileBase is fairly tightly coupled to the code in ListBase, its parent. This meant that if I wanted to override the function in my TileList extension, I had to rely on the super function in ListBase. But there is the catch! It isn’t the super function, it is the super.super function. And guess what, that isn’t supported in AS3. You cannot skip over the implementation of a function in an inherited class if you want an even earlier one. You can only override the previous instance in the chain. If you can’t get around having to write the override you have to then override all the functionality in all the super functions. Major Bummer.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>