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 load
and handle your initialization accordingly.

To help grasp the reasoning, remember that classes live in the global space.
That's how you're able to call a static method or access a static property
just by naming the Class.

Makes sense?

Bryan

> 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 creates a new copy of itself. one way to see that is creating a
> static
> counter variable that increases everytime the movie is loaded into the
> container.
> 
> Could some one point me to a site where I could understand why this is
> happening. I understand what is going on but I can't grasp the
> reasoning
> behind it so that I can avoid those duplicates.
> 
> TIA
> 
> --
> ...helmut


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to