mrEmpty Posted November 10, 2011 Share Posted November 10, 2011 Hello. With DynamicProps, is it possible to keep it hunting for the mouse even it it reaches it? In the example when it hits the target it stops, I'd like it to keep going. Cheers. Link to comment Share on other sites More sharing options...
GreenSock Posted November 10, 2011 Share Posted November 10, 2011 Sure, you can do that but it wouldn't be with dynamicProps because that feature is designed to allow your tween's duration to remain fixed and the end value(s) will change to make it look smooth on-the-fly. So if you say you want to tween to the mouse's position and you set your tween's duration to 2 seconds, that tween will end in 2 seconds. Therefore it won't keep moving towards the mouse after that. You could, however, use a MOUSE_MOVE listener or even an ENTER_FRAME listener to keep re-creating a new tween that moves to wherever the mouse is at that point. function mouseMoveHandler(event:MouseEvent):void { TweenLite.to(mc, 1, {x:mouseX, y:mouseY}); } Does that help? Link to comment Share on other sites More sharing options...
mrEmpty Posted November 10, 2011 Author Share Posted November 10, 2011 Hello. I don't know why I asked the question! I know I can use a standard tween to trace the mouse, but last night after not mooch sleep for a few days I had a moment of clarity about an idea to do with DynamicProps and it following the mouse! But I cannot for the life of me remember what it was. However, thank you for answering. Link to comment Share on other sites More sharing options...
mrEmpty Posted November 12, 2011 Author Share Posted November 12, 2011 One thing, what are these parameters on the end of a ThrowProps instance? etc etc}}, 1, 0.3, 1); Link to comment Share on other sites More sharing options...
GreenSock Posted November 12, 2011 Share Posted November 12, 2011 Those are some extra optional parameters that control things like maximum duration, minimum duration, and overshoot tolerance. If you watch the video on the main ThrowPropsPlugin page, it explains all of those (more towards the end). http://www.greensock.com/as/docs/tween/ ... n.html#to() Link to comment Share on other sites More sharing options...
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