Hey Jack,
That method does work, thanks, but I would like to make it a plugin. By "intercept the setting of the properties", I mean I need a layer in between the HexColorPlugin/BezierPlugin/SetActualSizePlugin/[OtherPluginsThatUseMethods]Plugin. So if I do {style:{hexColors:{backgroundColor:red}}}, it would build something like this:
TweenMax
StylePlugin
HexColorPlugin
Instead of...
TweenMax
HexColorPlugin
That way, in the StylePlugin, I could just create a new HexColorPlugin if I saw "hexColors" in the "style" Object, and it would do what it's supposed to do.
The issue is, that logic is in the TweenLite.init() method, where the Plugin is actually created, so the architecture only allows you to go one layer deep. By "one layer", I mean the tree above. So what if I wanted to bezier-tween the "setStyle" for "backgroundColor". Instead of using the "onUpdate" function and re-creating the BezierPlugin and HexColorPlugin logic, I could just do this:
TweenMax
BezierPlugin
StylePlugin
HexColorPlugin
... from this object:
TweenMax.to(target, 1, {bezier:{style:{hexColors:{backgroundColor:red}}}});
So the first layer, BezierPlugin, would see "style", so it would create a StylePlugin. Then the StylePlugin would see "hexColors", and would create the HexColorPlugin, and so on, infinitely. That way I could re-use the existing plugins without reverting to "onUpdate". That's what I mean by "intercept the setting of the properties".
If there was a logic like that built in, I could do a ton with reusing the existing plugins, and having plugins invoke other plugins.
Is that possible? What would it take?
Thanks,
Lance
P.S. While that bezier example can probably be done differently, I'm just looking to create a more flexible TweenPlugin system that allows Plugins to use/instantiate other Plugins