Indeed - that seems to be it.... thanks

Thanks John also!

________________________________________
From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Mattheis, Erik (MIN - 
WSW) [ematth...@webershandwick.com]
Sent: Thursday, May 13, 2010 11:04 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Buggy Tween

Could it be you have var tween_handler:Tween inside of a function? If it's a 
class variable it won't get garbage collected, if it within a function it's 
eligible for garbage collection when the function is complete.

YES:
class myClass {

var tween_handler:Tween;

function myFunction() {
 tween_handler = new Tween(mc,"alpha",Strong.easeInOut,1,0,.5,true);
}
}

NO:
class myClass {

function myFunction() {
 var tween_handler:Tween;
 tween_handler = new Tween(mc,"alpha",Strong.easeInOut,1,0,.5,true);
}
}

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr, Theodore
Sent: Thursday, May 13, 2010 6:11 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Buggy Tween

Thanks - for to need such hand holding.... I tried what you said but get the 
same results... What should be in the //do your stuff here?

as far as I have it now - the tween is still handled in the original tween 
(tween_handler in your example)....

________________________________________
From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of John R. Sweeney Jr 
[jr.swee...@comcast.net]
Sent: Wednesday, May 12, 2010 6:38 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Buggy Tween

Howdy,

> You tween objects got garbage collected.

I was bit very hard by that one in a kiosk touch screen that needed to have
certain things happen after the tween was finished. So when garbage
collection stopped the tween, things went very messed up and/or locked up.
:)

Here is how I fixed that:

var tween_handler:Tween;

tween_handler = new Tween(mc,"alpha",Strong.easeInOut,1,0,.5,true);
tween_handler .addEventListener (TweenEvent.MOTION_FINISH, doYourFunction;

function doYourFunction (evt:TweenEvent):void
{
    tween_handler .removeEventListener (TweenEvent.MOTION_FINISH,
doYourFunction);

    // do your stuff here
}



Then you should be fine,
John



on 5/12/10 2:44 PM, Lehr, Theodore at ted_l...@federal.dell.com wrote:

> thanks - I'll look into how to do that....


John R. Sweeney Jr.
Interactive Multimedia Developer

OnDemand Interactive Inc
945 Washington Blvd.
Hoffman Estates, IL 60169
Office/Fax: 847.310.5959
Cellular: 847.651.4469
www.ondemandinteractive.com

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to