home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 May / ME_2011_05.iso / Galileo-Video-Tutorial / system / player.swf / scripts / controller / VideoPlayerController.as < prev    next >
Encoding:
Text File  |  2010-11-30  |  2.9 KB  |  109 lines

  1. package controller
  2. {
  3.    import flash.events.Event;
  4.    import flash.events.EventDispatcher;
  5.    
  6.    public class VideoPlayerController extends EventDispatcher
  7.    {
  8.       private static var allowInstantiation:Boolean;
  9.       
  10.       public static var STATUS:String = "status";
  11.       
  12.       public static var JPG:String = "jpg";
  13.       
  14.       public static var OUTRO:String = "outro";
  15.       
  16.       public static var EXERCISEPATH:String = "exercisepath";
  17.       
  18.       private static var _pause:Boolean = false;
  19.       
  20.       private static var instance:VideoPlayerController = null;
  21.       
  22.       private static var _packshot:String = "";
  23.       
  24.       private static var _outro:String = "";
  25.       
  26.       private static var _exercisePath:* = "";
  27.       
  28.       public static var INTROCOMPLETE:String = "introcomplete";
  29.       
  30.       public function VideoPlayerController()
  31.       {
  32.          super();
  33.          if(!allowInstantiation)
  34.          {
  35.             throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
  36.          }
  37.       }
  38.       
  39.       public static function getInstance(param1:String) : VideoPlayerController
  40.       {
  41.          trace("VideoPlayerController.getinstance " + param1);
  42.          if(instance == null)
  43.          {
  44.             allowInstantiation = true;
  45.             instance = new VideoPlayerController();
  46.             allowInstantiation = false;
  47.          }
  48.          return instance;
  49.       }
  50.       
  51.       public function set pause(param1:Boolean) : void
  52.       {
  53.          trace("vpc pause " + param1);
  54.          _pause = param1;
  55.          dispatchEvent(new Event(STATUS));
  56.       }
  57.       
  58.       public function get pause() : Boolean
  59.       {
  60.          trace("vpc get pause");
  61.          return _pause;
  62.       }
  63.       
  64.       public function set packshot(param1:String) : void
  65.       {
  66.          trace("set packshot " + param1);
  67.          _packshot = param1;
  68.          trace("DISPATCH NOW");
  69.          dispatchEvent(new Event(JPG));
  70.       }
  71.       
  72.       public function get packshot() : String
  73.       {
  74.          return _packshot;
  75.       }
  76.       
  77.       public function set outro(param1:String) : void
  78.       {
  79.          trace("set packshot " + param1);
  80.          _outro = param1;
  81.          trace("DISPATCH NOW");
  82.          dispatchEvent(new Event(OUTRO));
  83.       }
  84.       
  85.       public function get outro() : String
  86.       {
  87.          return _outro;
  88.       }
  89.       
  90.       public function set exercisePath(param1:String) : void
  91.       {
  92.          trace("set _exercisePath " + param1);
  93.          _exercisePath = param1;
  94.          dispatchEvent(new Event(EXERCISEPATH));
  95.       }
  96.       
  97.       public function get exercisePath() : String
  98.       {
  99.          return _exercisePath;
  100.       }
  101.       
  102.       public function onIntroComplete() : void
  103.       {
  104.          dispatchEvent(new Event(INTROCOMPLETE));
  105.       }
  106.    }
  107. }
  108.  
  109.