I have a graphic object, let say a box, which is drawn on a html5 canvas, let say its position is (x: 50, y:50).
It is inside another container, whose position is (x:250, y:250).
So, global position of the box is (x:300, y:300).
Now, I want to move this box to global (x:100, y:100), and at the beginning I want to move the box from its container, to the global world.
So, I try to use onStart, when creating my tween with TweenLite.to. To keep its global position, I set the position of the box in its new parent:
onStart: {
box.setParent(stage);
box.position.set(300, 300);
}
As a result, the parent is set. But, position does not change.
Conclusion: In onStart, I am too late, the box properties was already "somehow" cached by the tween, and that I am changing it does not affect!
Question: Is there a way to update properties of the object after/within creating it and just before it starts?
Note: lazy: true did not work.
Note: setting the parent of the box before creating tween is not a choice.
Example: http://codepen.io/anon/pen/GoOWBy
Thank you.