Re: [Flashcoders] Singleton AS2

2007-09-09 Thread Rich Shupe
My assumption is that you have a scope problem. It seems like you're Singleton is working properly inside its own SWF, because you remarked that the duplication when loading was unusual. It sounds like you know that the Singleton pattern is designed to instantiate only one copy of itself, only if i

Re: [Flashcoders] Singleton AS2

2007-09-09 Thread Helmut Granda
Thanks Bryan, after I posted this yesterday I did some more testes and in fact came out to the conclusion of what you are describing... private function onUnload () { delete Singleton trace("deleted"); } It works, my variables get reset (counter) but there is still on

RE: [Flashcoders] Singleton AS2

2007-09-09 Thread Bryan Thompson
Assuming you are storing the Singleton instance in a static class variable, unloading the movie from your container does not remove the instance from the class. Try setting your instance property to null when you unload the app (via a die() call or something similar), or detect its existence on lo

[Flashcoders] Singleton AS2

2007-09-08 Thread Helmut Granda
I have 5 applications and one of them was created with the Singleton pattern, those 5 apps are being loaded at different times into a container, when any of the movies is loaded and unloaded everything works fine but everytime the movie with the Singleton pattern is loaded into the container it cre