We have been using the Greensock library in an Adobe AIR application for a while now with really no problems. We decided to try our Windows based application on an Android device and found that most things work quite well. The only problem we are seeing with the Greensock library turns up when we use scale effects. By this, I mean any time I attempt to scale a SplitTextField from say 4 to 1, the system lags. If I scale multiple SplitTextFields at once and by letter, then system can almost crash. The board we are using is running one of the latest version of Android and is capable of outputting HD content.
Below is the code for one of the animations being affected. Each letter should scale down and rotate in, staggered.
// target is the object we are going to animate // time is the total amount of time for the animation
public static function MyEffect(target:SplitTextField, time:Number):TimelineMax{
// Activate plugins
TweenPlugin.activate([TransformAroundCenterPlugin, AutoAlphaPlugin]);
// Create new TimelineMax Object
var t:TimelineMax = new TimelineMax();
// Determine how long each letter should animate
var timePerHold:Number = time / target.textFields.length;
// Go through each textField in the SplitTextField and complete the following animation
for(var x:int = 0; x < target.textFields.length; x++){
// Use 20% of the time to rotate the text and scale the text half way
t.fromTo(target.textFields[x], timePerHold * .2, {transformAroundCenter:{scale:4, rotation:-180}, alpha:0}, {transformAroundCenter:{scale:2, rotation:0}, alpha:1}); // Use 80% of the time to finish scaling the text
t.to(target.textFields[x],timePerHold * .8, {transformAroundCenter:{scale:1}, ease:Elastic.easeOut});
}
return t;
}
This is causing a memory leak. I have isolated it to the transformAroundCenter plugin using the scale feature. Any ideas on how to eliminate this?