I'm using the KineticPlugin and DirectionalRotationPlugin with a Timeline, and I noticed that the first timeline rotation works, but the subsequent one did not. Debugging the KineticPlugin.js source, I noticed that
_directionalRotationExp.test(val)
would evaluate to true on the first timeline 'to' action, and then false on the second one, even for the exact same value. This is what was causing the second action to fail to rotate.
I'm not Regex expert, but it appears to be due to the the global flag on the regex. See: http://stackoverflow.com/questions/1520800/why-regexp-with-global-flag-in-javascript-give-wrong-results
When I remove the 'g' from the regex definition, or recreate the regex inside the plugin definition, the test passes as expected, and everything works as expected.
Have I indeed found a 'bug', or is there something I'm doing wrong to cause this to happen? My code looks something like this:
var tl = new TimelineMax();
tl.to(obj, 2, {
kinetic: { rotationDeg: 270 + '_cw' },
});
tl.to(obj, 2, {
kinetic: { rotationDeg: 290 + '_cw' },
});
tl.play();
thanks!