Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package
  2. {
  3.     [Bindable]
  4.     public class PropertyEditorSingleton
  5.     {
  6.         private static var _instance:PropertyEditorSingleton = null;
  7.        
  8.         public var menuTextColor:uint = 0;
  9.         public var bgColor:uint = 3355443;
  10.         public var titleColor:uint = 6710886;
  11.         private var _colorLogoAlpha:Number = 0;
  12.                
  13.         public function PropertyEditorSingleton(enforcer:SingletonEnforcer)
  14.         {
  15.             if(enforcer == null)
  16.                 throw new Error("PropertyEditorSingleton is a singleton class, use getInstance() instead");
  17.         }
  18.    
  19.         public static function getInstance():PropertyEditorSingleton
  20.         {
  21.             if(_instance == null){
  22.                 _instance = new PropertyEditorSingleton(new SingletonEnforcer);            
  23.             }
  24.             return _instance;
  25.         }
  26.        
  27.     }
  28. }
  29.  
  30. internal class SingletonEnforcer {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement