Jump to content
Search Community

Setting minimum or maximum values for tweening

adrianparr test
Moderator Tag

Recommended Posts

Hi Jack,

 

I have a tween with easing (Back.easeOut) set up for a class which is used for a bunch (x12) of movieclips. I am basically tweening them on the Y axis. Everything is working fine, except the two movieclips near the top and bottom of the stage ease off stage slightly when tweening. Is there any was to set minimum or maximum values for Y so it is kept on stage? I've tried running an enterframe handler which checks it's own Y value and adjusts it if it needs to, but my tween is obviously overwriting it so it is having no effect. Basically I need to set some sort of limits or constraints.

 

Cheers in advance,

 

Adrian

(www.adrianparr.com)

Link to comment
Share on other sites

Sure, you could use an onUpdate to run your logic that corrects the position or just use easeParams to pass in the extra parameter that Back.easeOut accepts which controls how far the ease overshoots (you'd need to experiment with the value to see what will keep the object on stage). Or use CustomEase (if you're a Club GreenSock member) to do a similar thing (control how far things overshoot).

 

Hope that helps.

Link to comment
Share on other sites

doh. the Back ease has always been one of my favorites but I was always bummed when I wanted a little more or less Back. I've fiddled to my fancy with CustomEase but I can't believe I didn't know about easeParams!

 

 

after reading jack's suggestion I had to explore it.

 

this was a fun eye opener so I had to make a little vid.

 

Adrian, perhaps it will help you in the future

 

 

Carl

 

ps. THANKS Jack.

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...