[Tweener] x and y settings change during scaleX/Y Tween
Gerry Creighton
gerry at thespikeranch.com
Thu Oct 29 11:25:42 PDT 2009
If you create the "images" yourself in Flash then you can manually
change the registration point so that it is in the center.
If the images are placed on the stage dynamically or created
dynamically their registration point will be at 0,0. To get them to
scale up so that they don't move to the right and down you should find
a point to move the image to so that it moves from the
center of the image.
What I've done in the past is to create a couple of variables that
calculates the x and y positions minus the amount you want
to scale the image to. You can then tween to those points for x and y.
You'll have to store the original x and y positions in variables to
handle the rollOut.
I usually take the original x position and then subtract the image
width divided by 2. The same for the y position.
In your tween you should be calling "onUpdate: function name" to check
the location and size of the image you are scaling.
The function you call onUpdate will calculate where to move the image
based on the original position minus it's current width/height.
On rollout just tween back to original x y and width height. I'll try
to throw together an example if I get time.
Hope that helps.
-Gerry
On Oct 28, 2009, at 9:16 PM, Matt Tedeschi wrote:
> Rough, not sure what to do here. All I need to do is tween some
> images so that when you roll on, the object scales straight forward
> keeping its perspective, but it scales to the right & down.
>
> Any value I give x: makes the others lose there footing and slice
> all over the place.
>
> I'm using e.target as my object to Tween. Everything works great
> except providing a value for x:.
>
> Is there any way to lock my X/Y values or change the registration
> point my object?
>
> Thanks -
>
> Windows 7: I wanted more reliable, now it's more reliable. Wow!
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20091029/e22a969b/attachment-0001.htm>
More information about the Tweener
mailing list