Hi,
In a current project I have, I have a scrolling class that wraps each of its scrolling items in a custom class (scrollItem).
I would like people to be able to change this custom scrollItem class, but as the scroller class has some interaction with this scrollItem class (sets id etc), I have the scrollItem class implement an interface to guarantee the presence of the required methods.
This works fine, but only if I keep the type of the scrollingItem class within the scroller class. I would prefer to substitute in the interface type for each scrolling item. However, I cant, as the interface is not a DisplayObject. I can get around this by casting the interface type as a DisplayObject whenever it needs to do DisplayObject type things, but this seems like a hideous hack.
Should I just use an abstract class and have my scrollItem class extend it rather than an interface?
Seems like interfaces work better for non display list type classes, unless I’m missing something here?