RE: Singleton question

2014-11-14 Thread Kessler CTR Mark J
ce. -Mark -Original Message- From: Harbs [mailto:harbs.li...@gmail.com] Sent: Friday, November 14, 2014 3:54 AM To: users@flex.apache.org Subject: Re: Singleton question No. That’s wrong. It should be: private static var _instance:ModelLocator; public static function getInstance():ModelLoca

Re: Singleton question

2014-11-14 Thread Harbs
t;> } >>> >>> When I am debugging I see that _instance is always different object when >>> I >>> get an instance of my singleton. Is that right? >>> >>> Thanks >>> >>> >>> -- &g

Re: Singleton question

2014-11-13 Thread pkumar.flex
ing I see that _instance is always different object when I > get an instance of my singleton. Is that right? > > Thanks > > > -- > If you reply to this email, your message will be added to the discussion > below: > > http://apache-flex-us

Re: Singleton question

2014-11-13 Thread pkumar.flex
getInstance():ModelLocator >> { >> return _instance; >> } >> } >> } >> >> When I am debugging I see that _instance is always different object when >> I >> get an instance of my singleton. Is that right? >> >> Thanks >> >&g

Re: Singleton question

2014-11-13 Thread Alex Harui
Mark, English is an ambiguous language. That’s why it isn’t used as a programming language. For example, I have no idea what “get an instance” means. Use the profiler and see what it says. Maybe try posting links to screenshots of the debugger and code. Don’t attach screenshots to these email

Re: Singleton question

2014-11-13 Thread mark goldin
Yes, exactly. I am getting different ID every time I get an instance. On Thu, Nov 13, 2014 at 3:10 PM, Alex Harui wrote: > Are you referring to where FlashBuilder shows something like: (@1171655c1) > > It would be odd for that number to change for a Singleton within the same > debug session, but

Re: Singleton question

2014-11-13 Thread Alex Harui
Are you referring to where FlashBuilder shows something like: (@1171655c1) It would be odd for that number to change for a Singleton within the same debug session, but the number can certainly change from run to run. You can try the profiler and see how many instances of the Singleton it thinks i

Re: Singleton question

2014-11-13 Thread mark goldin
I meant a value that is shown in Debug Window in Value column when I select _instance in Name column . Value has unique number at the end. On Thu, Nov 13, 2014 at 2:46 PM, Alex Harui wrote: > Not sure what “internal name” means but I didn’t see any name property on > the code you supplied. Show

Re: Singleton question

2014-11-13 Thread Alex Harui
Not sure what “internal name” means but I didn’t see any name property on the code you supplied. Show us the code for “internal name”. On 11/13/14, 12:30 PM, "mark goldin" wrote: >The way I know that the object is different is I am checking its internal >name in the Debugger every time I get an

Re: Singleton question

2014-11-13 Thread mark goldin
The way I know that the object is different is I am checking its internal name in the Debugger every time I get an instance. On Thu, Nov 13, 2014 at 2:07 PM, Alex Harui wrote: > > > On 11/13/14, 11:33 AM, "mark goldin" wrote: > > > >When I am debugging I see that _instance is always different o

Re: Singleton question

2014-11-13 Thread Alex Harui
On 11/13/14, 11:33 AM, "mark goldin" wrote: >When I am debugging I see that _instance is always different object when I >get an instance of my singleton. Is that right? How do you know it is a different object? It could be that the code generator for [Bindable] is messing things up. You migh

Singleton question

2014-11-13 Thread mark goldin
Here is my singleton: [Bindable] public class ModelLocator extends EventDispatcher implements IModelLocator { private static var _instance:ModelLocator = new ModelLocator(); public var test:String; public function ModelLocator() { if (_instance != null){ throw new Error("You can have only one Mode