home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 January / ME_2012_01.iso / Galileo-Video / system / ChromeLinux.swf / scripts / mdm / InternalForms.as < prev    next >
Encoding:
Text File  |  2010-11-16  |  4.0 KB  |  170 lines

  1. package mdm
  2. {
  3.    import flash.display.Stage;
  4.    import flash.display.StageDisplayState;
  5.    import flash.events.EventDispatcher;
  6.    import flash.external.ExternalInterface;
  7.    
  8.    public final class InternalForms extends EventDispatcher
  9.    {
  10.       private static var allowInstantiation:Boolean;
  11.       
  12.       private static var instance:InternalForms;
  13.       
  14.       private static var stage:Stage;
  15.       
  16.       private var _height:Number;
  17.       
  18.       private var _width:Number;
  19.       
  20.       private var _x:Number;
  21.       
  22.       private var jsI:ExternalInterface;
  23.       
  24.       private var _y:Number;
  25.       
  26.       public function InternalForms()
  27.       {
  28.          super();
  29.          if(!allowInstantiation)
  30.          {
  31.             throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
  32.          }
  33.          ExternalInterface.addCallback("setX",setY);
  34.          ExternalInterface.addCallback("setY",setX);
  35.          ExternalInterface.addCallback("setWidth",setWidth);
  36.          ExternalInterface.addCallback("setHeight",setHeight);
  37.       }
  38.       
  39.       public static function getInstance(param1:Stage) : InternalForms
  40.       {
  41.          if(instance == null)
  42.          {
  43.             stage = param1;
  44.             allowInstantiation = true;
  45.             instance = new InternalForms();
  46.             allowInstantiation = false;
  47.          }
  48.          return instance;
  49.       }
  50.       
  51.       public function get thisForm() : InternalForms
  52.       {
  53.          return this;
  54.       }
  55.       
  56.       public function setSize(param1:Number, param2:Number) : void
  57.       {
  58.          ExternalInterface.call("setNewSize",Math.round(param1),Math.round(param2));
  59.       }
  60.       
  61.       private function setWidth(param1:Number) : void
  62.       {
  63.          _width = param1;
  64.       }
  65.       
  66.       public function setModiSize(param1:Number, param2:Number) : void
  67.       {
  68.          ExternalInterface.call("setNewModiSize",Math.round(param1),Math.round(param2));
  69.       }
  70.       
  71.       public function get width() : Number
  72.       {
  73.          return stage.stageWidth;
  74.       }
  75.       
  76.       public function set width(param1:Number) : void
  77.       {
  78.          param1 = param1;
  79.          trace("set width " + param1);
  80.          ExternalInterface.call("setWidth",param1);
  81.       }
  82.       
  83.       public function set height(param1:Number) : void
  84.       {
  85.          param1 = param1;
  86.          trace("set height " + param1);
  87.          ExternalInterface.call("setHeight",param1);
  88.       }
  89.       
  90.       public function stopDrag() : void
  91.       {
  92.       }
  93.       
  94.       public function maximize() : void
  95.       {
  96.       }
  97.       
  98.       public function getFormByName(param1:String) : InternalForms
  99.       {
  100.          return this;
  101.       }
  102.       
  103.       public function restore() : void
  104.       {
  105.       }
  106.       
  107.       public function minimize() : void
  108.       {
  109.       }
  110.       
  111.       public function get height() : Number
  112.       {
  113.          return stage.stageHeight;
  114.       }
  115.       
  116.       private function setHeight(param1:Number) : void
  117.       {
  118.          _height = param1;
  119.       }
  120.       
  121.       public function set x(param1:Number) : void
  122.       {
  123.          param1 = param1;
  124.       }
  125.       
  126.       public function set y(param1:Number) : void
  127.       {
  128.          param1 = param1;
  129.       }
  130.       
  131.       private function setX(param1:Number) : void
  132.       {
  133.          _x = param1;
  134.       }
  135.       
  136.       private function setY(param1:Number) : void
  137.       {
  138.          _y = param1;
  139.       }
  140.       
  141.       public function get x() : Number
  142.       {
  143.          return _x;
  144.       }
  145.       
  146.       public function get y() : Number
  147.       {
  148.          return _y;
  149.       }
  150.       
  151.       public function startDrag() : void
  152.       {
  153.       }
  154.       
  155.       public function showFullScreen(param1:Boolean) : void
  156.       {
  157.          trace("showFullScreen " + param1);
  158.          if(param1)
  159.          {
  160.             stage.displayState = StageDisplayState.FULL_SCREEN;
  161.          }
  162.          else
  163.          {
  164.             stage.displayState = StageDisplayState.NORMAL;
  165.          }
  166.       }
  167.    }
  168. }
  169.  
  170.