PDA

View Full Version : Page Refresh killing my tweens


muldis666
12-08-2008, 01:55 PM
Hello,

I have a flash book project which can be seen at: http://www.muldisdesigns.com/Pages/Home.html

It loads an external SWF (which is where the book and stuff are). It works fine on the first load, but if you try to visit the page again, or refresh the page without emptying the cache, all the tweens are dead (which means that essentially nothing works).

Am I missing something?? Doesn't flash reload the SWF each time? Why are all my other variables intact, and only my Tweens dead? I don't get it : (

Im guessing this is something you learn in school when they teach you flash, but I taught myself, and I can't find any info on it :/

Any help would be greatly appreciated!

muldis666
12-08-2008, 02:09 PM
Ok, thats weird.. a couple of my tweens survive, but the others are dead. Now I'm even more confused. I guess it isn't just the tweens that are the problem???

lordofduct
12-08-2008, 02:56 PM
It's GarbageCollection

tweens love to get collected up real easy. I don't know Flash's exact method of deciding what to clean up and what not to... but I've always noticed Tweens are near the top of the list of things to get disposed.

I always store strong references to my tweens to make sure they stick around. Then when they are complete I mark them to be disposed if they need to be disposed.



...
to tell you the truth I rarely use tweens as well. I find the Tween class to be rather lacking. That goes for those TweenMax packages and the sort.

But that's just personal preference.

muldis666
12-08-2008, 03:23 PM
lordofduct, thanks for the reply.. I was declaring my var's locally, and that was causing problems.. Now I'm having a new problem where my SWF is getting loaded before its done and I'm getting an Error #1009. But thats probably a topic for a new thread