TransformAroundCenterPlugin

[AS3/AS2] Normally, all transformations (scale, rotation, and position) are based on the DisplayObject's registration point (most often its upper left corner), but TransformAroundCenter allows you to make the 2D transformations occur around the DisplayObject's center. Keep in mind, though, that Flash doesn't factor in any masks when determining the DisplayObject's center.

If you define an x or y value in the transformAroundCenter object, it will correspond to the center which makes it easy to position (as opposed to having to figure out where the original registration point should tween to). If you prefer to define the x/y in relation to the original registration point, do so outside the transformAroundCenter object, like:

TweenLite.to(mc, 3, {x:50, y:40, transformAroundCenter:{scale:0.5, rotation:30}});

Usage

import com.greensock.TweenLite;
import com.greensock.plugins.TweenPlugin; 
import com.greensock.plugins.TransformAroundCenterPlugin; 
TweenPlugin.activate([TransformAroundCenterPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.
TweenLite.to(mc, 1, {transformAroundCenter:{scale:1.5, rotation:150}}); 

Get GSAP

Version: 1.20.4 updated 2018-02-15

Core

    Extras

      Plugins

        By using GreenSock code, you agree to the terms of use.

        For an all-access pass to premium content

        Join Club GreenSock