Core IAnimator in Spark
Man, it's very difficult to customize the animation system in spark. I realize that a lot of effort is going into it, but why not take a look at how simple and powerful openflux solved the problem?
For instance, in Spark, mixed into the core of the ScrollBar and the Slider are "private" variables for an "Animation" object that controls animating scrolling. Hardcore... There are a few things difficult about this approach:
1) You don't have access to that animator, other than through hard-coded instance methods that, if that philosophy were applied everywhere in Flex would get totally unmanageable.
2) There is no consistency in the design in which these animators are used, no interface, it's almost like they're just there to solve some super specific case, but good luck trying to solve the next.
3) It's built into the scrollbar, like the Scrollbar was built into the Flex 3 Container, and that wasn't the best idea. A "ScrollBar" doesn't by nature need an animator that animates its scrolling. That's an add-on.
If the UIComponent just had an IAnimator property that stored an object that could animate anything (or "play" "Animation" instances), that would be much more flexible. And I could use TweenMax or Tweener if I'd like, or Away3D's animation stuff using Flex's IAnimator interface.
In addition, this would make it extremely easy to animate layout properties, and animate between layouts (from Vertical to Horizontal for instance). To wire that up right now would be tough: I'd have to create my own Vertical and Horizontal Layouts and implement this whole system, or hack together something that would be hard to reuse or customize. All you'd need to do is add a controller to a component that grabbed a layoutElement position token and ran it through the animator, and the animator could do the fancy matrix/layout bound stuff.
I don't see why that's an issue. If someone has a reason why they don't want to do this, please let me know, because from my experience it's been a wonderful tool and makes development exciting and much easier.
Best,
Lance
