Jump to content
Search Community

Tweening without a movieClip trigger. Is this possible?

BakerShoeMaker test
Moderator Tag

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...