I figured out the case. I, actually, made first instance in another
module not in main App.
Conclusion is: if you make instance in your main app - everything works
fine.
If you did it in one of modules, this and all others will get new
instances. Very easy to see when put trace("BLAH") in the constructor.
PS. do not include your class, which suppose to be singleton in you main
application, and then it will fail.

test included  >> testSingleton.zip
<http://riahut.com/files/samples/testSingleton.zip>

>
> I beg to differ.  I had setup my app thinking this to be true.  When I
> did this the module would get it's own, and very different, instance
> of my singleton.  I had to change the way I did things so what I do
> now is upon loading my module, the main app then sets the singleton
> into the module.  I don't have my example code anymore, but it was
> quite easy to produce the results.
>
> Maybe it has to do with the way I compiled my module????  I compiled
> my application with "-link-report=c:\app\encoreNG.link.report.xml" and
> my module with "-load-externs=c:\app\encoreNG.link.report.xml".  Not
> sure if that has anything to do with it.  Also, when I had this coded
> I was on Flex 3, Beta 3 and have not retested with Flex 3 GA.
>
> Dale

Reply via email to