Hello :)
use internal keyword it's more easy :
http://groups.google.com/group/FCNG/browse_thread/thread/b16a38f8389803a0/8ff037af609e7b94#8ff037af609e7b94
text\Singleton.as
------
package test
{
public const Singleton:_Singleton = new _Singleton();
}
internal class _Singleton
{
function _Singleton()
{
}
public const testconst:String = "hello world";
public var testvar:String = "bonjour le monde";
public function testMethod():String
{
return "ni hao shijie";
}
}
------
testSingleton2.as
------
package
{
import flash.display.Sprite;
import test.Singleton;
public class testSingleton2 extends Sprite
{
public function testSingleton2()
{
trace( Singleton.testconst );
trace( Singleton.testvar );
trace( Singleton.testMethod() );
}
}
}
Thanks Zwetan for this good solution.
EKA+ :)
2006/7/10, Weyert de Boer <[EMAIL PROTECTED]>:
I am told private constructors should jsut work fine (in AS2 though)
_______________________________________________
[email protected]
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
_______________________________________________
[email protected]
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