Jump to content
Search Community

Problem with getting simultaneous animations in sync

obi_wan test
Moderator Tag

Recommended Posts

Hey everyone I have this tilt animation that just cant get right. Essentially what I am trying to achieve is the following:

When the animation is started it sort of slightly swings from left to right with sort of a realistic swing. I have it sort of working but I cant get the tilt left and tilt complete methods to happen together with out it overwritting each other. So as temporary solution I am using the onComplete.

 

But if anyone could help me out here I would really appreciate it.

 

 

 

tiltRight();

private function tiltRight():void
 {
TweenLite.to(_settings, 1.5, {transformAroundPoint:{point:new Point(500,-18), rotation:-6 }, y:-18, alpha:1, ease:Bounce.easeOut,  
        onComplete:tiltLeft });		
  }
private function tiltLeft():void
   {
TweenLite.from(_settings, .5, {transformAroundPoint:{point:new Point(500,-18), rotation:-6 }, onComplete:tiltComplete });	
   }
private function tiltComplete():void
   {
TweenLite.to(_settings, 1.5, {transformAroundPoint:{point:new Point(500,-18), rotation:0 }, ease:Bounce.easeOut });
   }

Link to comment
Share on other sites

hi Obi_wan,

 

welcome to the message boards!

 

2 things, When doing multiple tweens on the same object with TweenLite you should set the overwrite mode to 2 (there are others, but this works great for 99% of what you want).

 

OverwriteManager.init(2);

 

http://www.greensock.com/overwritemanager/

 

-----------

 

perhaps it may be too early in your learning (probably not) but if you want to make a sequence of tweens I strongly recommend you use TimelineLite/Max.

you can easily have tweens play one after the other without doing all the onCompletes.

 

the code would look like this:

 

var tl:TimelineLite = new TimelineLite()

 tl.append( TweenLite.to(_settings, 1.5, {transformAroundPoint:{point:new Point(500,-18), rotation:-6 }, y:-18, alpha:1, ease:Bounce.easeOut }) );      

   tl.append(TweenLite.from(_settings, .5, {transformAroundPoint:{point:new Point(500,-18), rotation:-6 }, onComplete:tiltComplete }) );   


  tl.append( TweenLite.to(_settings, 1.5, {transformAroundPoint:{point:new Point(500,-18), rotation:0 }, ease:Bounce.easeOut }) );

 

let me know if this helps alleviate whatever problems you were experiencing.

 

Carl

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