import com.greensock.TweenLite;
import com.greensock.plugins.TweenPlugin;
import com.greensock.plugins.TransformAroundPointPlugin;
import com.greensock.plugins.TransformAroundCenterPlugin;
import flash.display.Sprite;
TweenPlugin.activate([TransformAroundPointPlugin, TransformAroundCenterPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.
var container:Sprite = new Sprite();
container.name = "container";
container.graphics.clear();
container.graphics.beginFill(0xff00ff,1);
container.graphics.drawRect(0, 0, 300, 300);
container.graphics.endFill();
this.addChild(container);
var mc:Sprite = new Sprite();
mc.name = "mc";
mc.graphics.clear();
mc.graphics.beginFill(0xffff00,1);
mc.graphics.drawRect(0, 0, 100, 100);
mc.graphics.endFill();
container.addChild(mc);
TweenLite.to(mc, 2, {transformAroundCenter:{scale:2, rotation:360}, delay:1});
TweenLite.delayedCall(0.5, remove)
function remove() {
container.removeChild(mc);
}
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.greensock.plugins::TransformAroundPointPlugin/_onInitTween()[/Active/_Flash/_AS3_v12/src/com/greensock/plugins/TransformAroundPointPlugin.as:96]
at com.greensock.plugins::TransformAroundCenterPlugin/_onInitTween()[/Active/_Flash/_AS3_v12/src/com/greensock/plugins/TransformAroundCenterPlugin.as:58]
at com.greensock::TweenLite/_initProps()[/Active/_Flash/_AS3_v12/src/com/greensock/TweenLite.as:590]
at com.greensock::TweenLite/_init()[/Active/_Flash/_AS3_v12/src/com/greensock/TweenLite.as:555]
at com.greensock::TweenLite/render()[/Active/_Flash/_AS3_v12/src/com/greensock/TweenLite.as:700]
at com.greensock.core::SimpleTimeline/render()[/Active/_Flash/_AS3_v12/src/com/greensock/core/SimpleTimeline.as:166]
at com.greensock.core::Animation$/_updateRoot()[/Active/_Flash/_AS3_v12/src/com/greensock/core/Animation.as:570]
I see that delay bigger than start moment. But it is not rare situation too...