Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package as3.enum
  2. {
  3.     {
  4.         Day.MONDAY = new Day(new DayType("Monday", 2));
  5.     }
  6.    
  7.     public class Day
  8.     {
  9.         static private var _MONDAY:Day;
  10.         public static function get MONDAY():Day
  11.         {
  12.             return _MONDAY;
  13.         }
  14.         public static function set MONDAY(value:Day):void
  15.         {
  16.             if (null == value)
  17.                 return;
  18.            
  19.             _MONDAY = value;
  20.         }
  21.        
  22.        
  23.        
  24.         public function Day(type:DayType=null)
  25.         {
  26.             if (!(type is DayType))
  27.             {
  28.                 throw new Error("error");
  29.             }
  30.         }
  31.        
  32.  
  33.     }
  34.    
  35. }
  36.  
  37. internal class DayType
  38. {
  39.     public var day:String;
  40.     public var weekday:Number;
  41.    
  42.     function DayType(dayStr:String, weekdayNum:Number):void
  43.     {
  44.         day = dayStr;
  45.         weekday = weekdayNum;
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement