>When I am debugging I see that _instance is always different object when I get 
>an instance of my singleton. Is that right?

I don't know if this is helpful:
I've tested your singleton implementation by creating some instances of 
'ModelLocator'.
As expected it always returns the same instance of 'ModelLocator' with the same 
"object id" (@9760161)'.
So if you have a different behaviour you should do some research to make sure 
your singleton works as expected.

<fx:Script>
<![CDATA[
private var modelLocator1:ModelLocator;
private var modelLocator2:ModelLocator;
private var modelLocator3:ModelLocator;
private var modelLocator4:ModelLocator;

public function init():void{
        modelLocator1 = ModelLocator.getInstance();  // ModelLocator (@9760161)
        modelLocator2 = ModelLocator.getInstance();  // ModelLocator (@9760161)
        modelLocator3 = ModelLocator.getInstance();  // ModelLocator (@9760161)
        modelLocator4 = ModelLocator.getInstance();  // ModelLocator (@9760161)
}
]]>
</fx:Script>

Olaf


________________________________

Edscha Holding GmbH
Sitz der Gesellschaft: Remscheid
Registergericht: Wuppertal, HRB 22889
Geschäftsführung: Francisco J. Riberas Mera, Francisco López Peña, David 
Vázquez Pascual, Torsten Greiner, Markus Kirchner, Hans-Peter Schulz und Volker 
Weiss

Vertretungsberechtigt sind nur Geschäftsführer und schriftlich Bevollmächtigte.

Solely Managing Directors or employees with a written proxy have got power of 
representation.

Der Inhalt dieser E-Mail einschließlich etwaiger beigefügter Dateien ist 
vertraulich und nur für den Empfänger bestimmt. Sollten Sie nicht der 
bestimmungsgemäße Empfänger sein, ist Ihnen jegliche Offenlegung, 
Vervielfältigung, Weitergabe oder Nutzung des Inhalts untersagt. Bitte 
informieren Sie in diesem Fall unverzüglich den Absender und löschen Sie die 
E-Mail einschließlich etwaiger beigefügter Dateien von Ihrem System. Vielen 
Dank.

The contents of this e-mail including any attachments are confidential and may 
be legally privileged. If you are not the intended recipient, any disclosure, 
copying, distribution or use of its contents is strictly prohibited, and you 
should please notify the sender immediately and then delete this e-mail 
including any attachments from your system. Thank you.

Reply via email to