Jump to content
Search Community

moving and scaling at the same time

ramezrafla test
Moderator Tag

Recommended Posts

Thanks Jack for fixing a prior issue.

 

I am trying to move a Sprite (i.e. animate x and y) while scaling.

I tried the following methods, and find that the last tween in the sequence takes over (while the first ones are forced to their completion right away - i.e. OverwriteManager kicks in)

1) Using straight x,y and transformAroundPoint (for 'scaleX' and 'scaleY')

2) using transformAroundPoint for x, y, scaleX and scaleY

 

Do you have any advice around that?

Link to comment
Share on other sites

Could you post your code sample(s) (or even better, an FLA that demonstrates the issue)? It sounds like maybe you're just using TweenLite in its default overwrite mode of ALL_IMMEDIATE which can easily be changed to AUTO mode with OverwriteManager.init(2). Or set the overwrite special property for each tween (I much prefer just setting the default mode to AUTO though).

 

Keep in mind that it's logically impossible to tween the x/y properties while doing a transformAroundPoint tween on the same object since the transformAroundPoint affects the x/y as well (it'd be kinda like doing TweenLite.to(mc, 1, {x:100, x:200, y:50, y:300}))

Link to comment
Share on other sites

That's exactly it Jack, there is a collision of properties. We either

(1) have to merge all the tweens into one transformaroundpoint if all tweens are to start at the same time, or

(2) expect that as the new tween starts (probably with a delay), the transform matrix at that point is altered with the new properties being tweened. My question is whether there is a way to have this done automatically by the 'Tweening' engine, or find a way to use updateTo / dynamicProps to alter it when we need to dynamically.

Link to comment
Share on other sites

Could you walk me through a practical use case? You want to be able to have a transformAroundPoint tween start and only overwrite portions of a concurrent one? Like if tween1 is tweening the rotation around a point (which of course affects the x/y as well) and then halfway through tween1 you want to start tween2 which scales the same object and you want it to take the rotation info from tween1 and inject it into tween2 without you telling it to do so specifically? Why not just track the rotation and scaleX/scaleY destination values and plug them in to subsequent tweens? I suspect I'm just not understanding what you're after exactly.

 

An example FLA would be SUPER helpful. The simpler the better (no need to post your production files)

Link to comment
Share on other sites

Thanks Jack for your reply. You have the sequence of an example right. In fact, thinking about it further I think I have an elegant solution.

Use containers! So we animate the sprite one way (say rotations using transformAroundPoint or center), and the container another (say x,y).

Just tried it and it works!

 

I know a pic (or an FLA) says a thousand words, but I use a wrapper around the tweening classes, so don't really have something to show per se.

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