public class Singleton{

     private static var instance:Singleton;

     public function Singleton(): void{
         if(instance != null)
             throw new Error("Singleton pattern error");
         else
             super();
     }

     public static function getInstance():Singleton{
        if(instance == null)
            instance = new Singleton();
        return instance;
     }


}

Sidhu Vijay Sidhu wrote:
> How will u make singleton in Action Script as there is no private
> constructor. If some on can send a code with small example that will be
> fine. thanks in advance

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to