topical media & game development
[] readme course(s) preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthought(s) appendix reference(s) example(s) resource(s) _

talk show tell print

professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator.ax

professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator.ax (swf ) [ flash ]


  package com.wiley.proflex2.chapter21.model
  {
          import com.adobe.cairngorm.model.professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator;
          import com.wiley.proflex2.chapter21.vo.WeatherVO;
          import mx.events.IndexChangedEvent;
          
          [Bindable]
          public class professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator implements com.adobe.cairngorm.model.professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator
          {
                  private static var modelLocator:com.wiley.proflex2.chapter21.model.professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator;
                  
                  public static function getInstance():com.wiley.proflex2.chapter21.model.professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator
                  {
                          if (modelLocator == null)
                                  modelLocator = new com.wiley.proflex2.chapter21.model.professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator();
                          
                          return modelLocator;
                  }
                  
                  public function professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator()
                  {
                          if ( com.wiley.proflex2.chapter21.model.professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator.modelLocator != null )
                                  throw new Error( "Only one professional-flex-code-21-com-wiley-proflex2-chapter21-model-ModelLocator instance should be instantiated" );
                  }
                  
                  // Store the location id
                  public var location:String;
                  
                  // The current weather for that location id
                  public var weather:WeatherVO;
                  
                  public var showWeatherDetail:Boolean = false;
                  public var backgroundColor:uint = DAYTIME_COLOR;
                  
                  public const DAYTIME_COLOR:uint = 0x93BCF6;
                  public const NIGHTTIME_COLOR:uint = 0xB6B3C1;
          }
  }


(C) A. Eliëns 2/9/2007

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.