Jump to content
Search Community

I need HELP with transformAroundCenter & bug position x, y

eman87 test
Moderator Tag

Recommended Posts

Hi, i need some help, today i think i detect a bug using the plugin TransformAroundCenter, when i call :

TweenMax.to(myMc, .5, {transformAroundCenter:{scale:0}, ease:Expo.easeOut, onComplete:function(){

TweenMax.to(myMc, 0, {transformAroundCenter:{scale:2}})

myFunction()

})

 

Then...

 

myFunction(){

TweenMax.to(myMc, .5, {transformAroundCenter:{scale:1}, ease:Expo.easeOut})

}

 

The big bug, its when rescale to 1, the position of y its not equal, i mean if the y position before call "transformAroundCenter" was 200, after call the y position its different, and never back to be equal.

I need help to find a solution because im try to reset the y position but the jump its very visible, and i cant do a tween to the y position because then its very different the position....

Link to comment
Share on other sites

can you please re-post your code exactly as it is in your fla so that it can be tested?

 

as it is now it has syntax errors.

 

the following quick demo shows that the y of the clip does in fact get set back to its initial value:

 

import com.greensock.*;
import com.greensock.plugins.*;

TweenPlugin.activate([TransformAroundCenterPlugin])
trace(mc.y)
TweenMax.to(mc, 1, {transformAroundCenter:{scale:1.5}, onComplete:getY})
TweenMax.to(mc, 1, {transformAroundCenter:{scale:1}, delay:1, onComplete:getY})


function getY(){
trace(mc.y);
}

 

in my example mc starts with y of 200;

 

first trace:200

trace after first tween: 175;

trace after final tween: 200;

 

I would avoid nesting anonymous functions inside your TweenMax calls.

 

I will gladly test your code once it is formatted correctly.

 

thanks

 

Carl

Link to comment
Share on other sites

Carl, very thanks for reply but recently i found a solution for the bug.

Here the solution:

 

TweenMax.to(Object(parent)._preview, .5, {transformAroundCenter:{scale:1},y:iniY, alpha:1, ease:Expo.easeOut})

 

The problem still present if i dont correct the "y" position, like before i post, but the correct way to back to my "y" position its adding my "y" out of "transformAroundCenter", like here i show.

 

Anyway, this for me its a bug of this plugin, and greensok it would have fix because im never change the "y" position.

Link to comment
Share on other sites

Nope, that definitely isn't a bug. I think you might be misunderstanding the nature of the registration point and how it would be affected by scaling around the center. Imagine a 100x100 image that has its registration point in its upper left corner. Let's say it starts at coordinates 0,0. If we scale it to half size around its center, that means the coordinates of the top left corner would end up at 25,25. See what I mean?

 

Not a bug.

 

If the x/y coordinates stayed the same, that means it couldn't scale from the center - it would be scaling from the upper left corner (assuming that's where the registration point is).

 

Does that clear things up?

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