Jump to content
Search Community

Tweening Convert Problem

CappMarvell test
Moderator Tag

Recommended Posts

Hi,

 

This is my first time using Tweenlite and I could use some help.

 

The built in tween for Flash/ActionScript has been acting "glitchy", so I've decided to convert to Tweenlite. Here's the code I'm converting:

 

function contentScroll():void	{
var navLtTween:Tween = new Tween(contentHolder, 'x', Strong.easeOut, contentHolder.x, (currMenuPos * -1), 4, true);
}

 

...and here's what I converted it to:

 

function contentScroll():void	{
var navLtTween:TweenLite = new TweenLite(contentHolder, 4, {x:String(contentHolder.x), y:String(currMenuPos * -1), ease:Elastic.easeOut});
}

 

The tween basically moves from side-to-side, depending on where the contentHolder is located. Except for the occasional hiccup, this worked fine with the former code. With the Tweenlite change, the "content" moves up to the right off-screen, which is not what I want. I was expecting it to "move" exactly as before (but without the "glitch").

 

Is there a problem with the way I converted the code to the Tweenlite version?

 

Thanks.

 

Stephen

Link to comment
Share on other sites

It should be as simple as:

 

function contentScroll():void   {
   var navLtTween:TweenLite = new TweenLite(contentHolder, 4, {x:currMenuPos * -1, ease:Strong.easeOut});
}

 

or since it doesn't look like you need to keep track of the tween instance anyway, you could simply do:

 

function contentScroll():void   {
   TweenLite.to(contentHolder, 4, {x:currMenuPos * -1, ease:Strong.easeOut});
}

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