BakerShoeMaker Posted February 4, 2015 Share Posted February 4, 2015 I've been researching Greensock solutions that tween frames. I've found the FramePlugin, FrameLable, etc. However, each of those requires the trigger to be the movieclip. However, I would like for a swipe to be the trigger instead of touching or interacting with a movieclip. In the project I would like the user to be able to swipe left or right to go to the previous or next page (frame). Is this possible with Greensock? Link to comment Share on other sites More sharing options...
Carl Posted February 4, 2015 Share Posted February 4, 2015 I think you will find ThrowPropsPlugin helpful: http://greensock.com/throwprops-as Link to comment Share on other sites More sharing options...
BakerShoeMaker Posted February 11, 2015 Author Share Posted February 11, 2015 Thanks for your response. Sorry for responding so late. I didn't recieve an alert message for this post. The problem I'm having is figuring out how to add Greensock functionality (e.g. Throwpops, FrameLabel plug-in etc.) without triggering a movieclip. In my case I want the user to be able to swipe left or right to go to the next frame. It is a book project and I want the user to be able to swipe from page to page (frame to frame) I also want to add some visual interest as they swipe from frame to frame. Link to comment Share on other sites More sharing options...
Carl Posted February 12, 2015 Share Posted February 12, 2015 ThrowPropsPlugin has no dependencies on MovieClips or interacting with a MovieClip in any way as a trigger. All you need to do is give ThrowPropsPlugin an initial velocity and it will take care of the rest. Your code can be as simple as import com.greensock.*; import com.greensock.plugins.*; TweenPlugin.activate([ThrowPropsPlugin]); ThrowPropsPlugin.to(mc, {throwProps:{x:500, resistance:150}}); Notice there is no code involving mouse events or any interaction with any objects. For your situation you could probably have the stage listen for mouse DOWN - UP events so that you can start tracking the velocity of the mouse (or touch point) and then feed that velocity into a ThrowProps tween (look up track() method in docs). You will not be able to use ThrowPropsPlugin and FramePlugin in the same tween, but you can just tween a simple numeric property of an object and then APPLY that value to whatever movieclip frame you want to. Read the docs, http://greensock.com/asdocs/com/greensock/plugins/ThrowPropsPlugin.html, start simple and then if you have more specific questions, just post a simple example. 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