Jump to content

Search In
• More options...
Find results that contain...
Find results in...

# Simultaneous Scale & Position Tween

## Recommended Posts

Greetings from Beautiful Boise!

I have a Sprite in which are several other Sprites as Children. The Parent Sprite is quite large: about 3500 Pixels square, and I have scaled it down (.2) to fit into a relatively small area on my Stage.

My goal is to, via a ComboBox Selection, enlarge the Parent Sprite to a scaleX = scaleY = 1 (apologies, I'm not using the GreenSock ScalePlugIn on this) while simultaneously moving the Parent Sprite so that the Child is "zoomed in to."

In other words, I have a large aerial photograph of a golf course that is scaled down, and I wish to scale it up and zoom into a hole simultaneously. I am scaling it via the TransformAroundPointPlugin (it's center point)...

Using two TweenMax tweens is not working: The scaling works well but the tween to the Hole Point (x, y) uses the intial value of the Point prior to the Scale Up and I can't figure out how to get around that.

I've looked at the OverwriteManager but that doesn't seem to be a solution in this case...or perhaps I'm missing something.

Any suggestions on how to produce such a functionality?

Thanks!

##### Share on other sites

you can do this in 1 tween.

i have an mc with width:260 height:200

`TweenLite.to(mc, 3, {transformAroundPoint:{point:new Point(130, 100), pointIsLocal:true, scaleX:.5, scaleY:.5, x:100}});`

the above tween creates a new point at 130, 100 (the center of mc) and scales down around that point AND also moves that new "registration point" to an x of 100.

if you are tweening around the center, you could just use

TweenLite.to(mc, 3, {transformAroundCenter:{scale:0.5, x:100}});

does that work for you?

##### Share on other sites

Thank you very, very much Carl. I had tried the pointIsLocal: true parameter but had some other issues that were compounded by my being dumber than dirt.

I've got 'er working now. Happy!

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