Thursday 8 August 2013

TweenMax to Universal Tween Engine porting bug

TweenMax to Universal Tween Engine porting bug

I have the following AS3 code
for (var i:int = 0; i < _triangles.length; i++)
{
var t:Triangle = _triangles[i] as Triangle;
TweenMax.to(t, 10, { alpha:x, delay:d, ease:Cubic.easeOut } );
}
At iteration no. 241, for example, TweenMax.getTweensOf(_triangles).length
gives a value of 241. How come that AS3 does it for the whole array when
only one element is specified at each iteration???
The reason it's a big question is that in Java this would be
for (Triangle t : _triangles)
Tween.to(t, TriangleAccessor.ALPHA,
10f).delay(d).ease(Cubic.OUT).target(x).start(tweenManager);
where tweenManager.getObjects().size() gives 241, just like in case of
AS3, but the resulting animation is completely different: the Java app
shows all animations nearly at the same time and at random positions,
while the AS3 code shows it gradually expanding from the center of the
screen to all directions. And tweenManager.containsTarget(t) is true while
tweenManager.containsTarget(_triangles) returns false which means that
indeed the tween applies not to the whole array. Any ideas how to
reproduce the AS3 behavior in Java?

No comments:

Post a Comment