Jump to content
Search Community

TransformAroundCenter Plugin Questions

CaptShmo test
Moderator Tag

Recommended Posts

Hey all, I have a few questions about the TransformAroundCenter plugin. I use it a lot, but wonder if there might be easier ways to do some of my most common tasks

 

1) I find myself often calling TweenLite.to(myMovieClip, 0, {transformAroundCenter:{scale:1}}) when I first load graphical elements to instantly set their registration point to the center. Otherwise, when I use transformAroundCenter, it changes the x/y position of my asset. Is there any better way to do this? I find myself doing this for applying Filter plugins as well. Any chance of getting a TweenLite.apply() function or something similar, so we can automatically apply a filter or transformation without a timescale? (timescale is always 0). I still notice some problems when tweening an item to scale:0 or when using timescales of 0. Has been this addressed in the last 3 months or so? I believe that's the last time I downloaded a tweenlite package.

 

2) Is there any change of getting a variable or some other way of using transformAroundCenter where it maintains the initial x/y placement of an object? Most of the time I don't know I'm using a center transformation until after I've done all my layout code, and often I have to go back and replace things based on a center registration point.

 

Please let me know if there's some better way of managing this, or if any part of my methodology is wrong. thanks so much!

Link to comment
Share on other sites

Hmm...I think you may be misunderstanding how transformAroundCenter works. It doesn't actually change the target's registration point. I'm confused as to what you think doing a transformAroundCenter:{scale:1} initially accomplishes for you.

 

Let's say, for example, that your target's registration point is in its upper left corner (pretty typical) and that it is positioned at x:0, y:0. Let's say it's a perfect square at 100% scale, 200 pixels by 200 pixels. If you do this:

 

TweenLite.to(mc, 1, {transformAroundCenter:{scale:0.5}});

 

It would shrink the object so that it is 100x100. Its x and y properties would now be at 50, 50. So it is SUPPOSED to change your object's x/y coordinates (well, unless they happen to already be positioned in the center but then there's no reason to use transformAroundCenter in the first place). It sounded like you expected to be able to do a transformAroundCenter without it altering your target's x/y values. That'd not only be impossible but illogical.

 

By the way, if you put x and/or y properties inside your transformAroundCenter, it will tween the center of the object to those coordinates (which can be very handy).

 

Did that answer your question(s)?

Link to comment
Share on other sites

Hey Jack, thanks for responding. What i'm experiencing is a combination of factors, i think i'm just not doing a very good job of expressing it, I have a sinus infection right now and am not at full brain capacity. I'll try to post a demo-file if I don't resolve it on my own, thanks for your response.

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