Quote:
Originally Posted by GFX Complex
Why not just use Action Script to tell the swf to go back in the initial state?
I still don't understand why you are trying to go about reloading the whole swf file just to refresh the initial state?
I think you will end up doing more then you should just to get the same results that you can get by using action script.
But then again if you can give me one reason why you can't use action script to do this. I will personally find the solution to your question.
|
The reason is throughout my code i think i've been sloppy. So instead of nulling all objects out of memory, at the end some objects will still be in memory. So if i let the app go to frame 1 and reload the app that way, it will run slower the second time, because old objects are still in memory.
I know that is my fault, but when coding this project i was somewhat inexperienced.
A reset of the app's state would avoid the memory leak problems created through my sloppy coding.
The same is the case for certain variables and timers. It's too late into the project to properly recode everything so that every object will be nulled after use and every variable will be reset and every timer will be reset.
So the hard full reset of the application state is kind of my last tool to avoid a major rewrite for which there is no time.
However if you say it's possible to use only AS3 to go to the initial state of the app without reloading the page or the swf, then that would be the best solution. However i have no idea how to reset an swf to it's initial state without reloading the page, that was kind of the difficulty.
Is there something like a reset function in AS, which resets an swf to its initial state without reloading the page? (A full hard reset, which clears memory and resets variables and timers)