[Tweener] Tweener clip memory buildup?
Jason F. Mortara
JFM at bluefang.com
Tue May 19 14:06:52 PDT 2009
I love Tweener!
I'm having some issues with performance slowdown over time of my
content. I've been trying to eliminate things one at a time, and now I'm
down to wondering if my use of Tweener will bypass Flash's garbage
collection. Performance is fine at first, but after say 10 or 20 minutes
things start to slow down visibly.
I've got these avatars, and when they go off line / disappear from the
gameworld, they leave a brief good-bye message behind. After 3 seconds
that message disappears.
function showAvatarExitPopup(av:MovieClip):Void
{
trace("showAvatarExitPopup("+av+")");
var avX:Number = av._x;
var avY:Number = av._y;
var avContainer:MovieClip = av._parent;
var avatarExitPopup:MovieClip;
avatarExitPopup = avContainer.attachMovie("avatarExitPopupMC",
"avatarExitPopup"+random(10000), avContainer.getNextHighestDepth(),
{_x:avX, _y:avY} );
avatarExitPopup.alert_txt.text = "I'm out! See ya!"
Tweener.addTween( avatarExitPopup, { _xscale:1, _yscale:1,
_alpha:0, time:.3, delay:3, transition:"easeInOutCubic",
onComplete:function() { avatarExitPopup.removeMovieClip(); } } );
}
Now... I wonder, usually I would expect the last inline function to work
normally.
Tweener.addTween( avatarExitPopup, { _xscale:1, _yscale:1, _alpha:0,
time:.3, delay:3, transition:"easeInOutCubic", onComplete:function() {
avatarExitPopup.removeMovieClip(); } } );
But... because there is a 3 second delay on this function, perhaps by
the time it is called, the local var avatarExitPopup no longer exists as
a reference? And therefore using the reference's removeMovieClip method
won't work?
Any thoughts on reliably using removeMovieClip as an onComplete method
of Tweener?
Thanks!
jfm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20090519/5cd78010/attachment.htm>
More information about the Tweener
mailing list