MarkFromOP Posted March 28, 2013 Posted March 28, 2013 I know I am missing something here, can I have an onComplete call in a Trasform Matrix tween? Here is what I have import com.greensock.*;import com.greensock.easing.*;import com.greensock.plugins.TweenPlugin;import com.greensock.plugins.TransformMatrixPlugin;TweenPlugin.activate([TransformMatrixPlugin]); TweenMax.to(mc, 2, {transformMatrix:{rotation:-15, ease:Quad.easeInOut, onComplete:myFunction}}); The tween works nicely but just dead ends on the end never calling myFunction
jamiejefferson Posted March 28, 2013 Posted March 28, 2013 You can absolutely do this; you just have a small nesting issue with your properties: // Bad - has ease and onComplete inside the transformMatrix properties TweenMax.to(mc, 2, {transformMatrix:{rotation:-15, ease:Quad.easeInOut, onComplete:myFunction}}); // Good - tween has three properties: transformMatrix, ease and onComplete TweenMax.to(mc, 2, {transformMatrix:{rotation:-15}, ease:Quad.easeInOut, onComplete:myFunction}); If you find managing braces is too fiddly, you could always spread the properties over multiple lines: TweenMax.to(mc, 2, { transformMatrix:{ rotation:-15 }, ease:Quad.easeInOut, onComplete:myFunction }); 1
MarkFromOP Posted March 28, 2013 Author Posted March 28, 2013 Perfect, problem solved. Thank you so much for the instant response now I can move on. Love GreenSock, proud member!! Again can't say enough about these plug ins they never cease to amaze me. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now