home *** CD-ROM | disk | FTP | other *** search
/ Canadian Forces: Prepare for Takeoff as a Pilot / CF_FS_Air.iso.iso / pc / data / swf / flashpaper / 102_fr.swf / scripts / frame_2 / DoAction_4.as < prev    next >
Text File  |  2004-09-01  |  3KB  |  106 lines

  1. FPController = function(model_o, view_o)
  2. {
  3.    this.model = model_o;
  4.    this.view = view_o;
  5.    Stage.addListener(this);
  6.    Key.addListener(this);
  7.    ASBroadcaster.initialize(this);
  8. };
  9. FPController.prototype.zoomTo = function(percent_i, source_o)
  10. {
  11.    if(percent_i != this.view.pageFitScale && percent_i != this.view.pageWidthScale)
  12.    {
  13.       this.view.viewMode = "zoom";
  14.    }
  15.    this.broadcastMessage("onZoom",percent_i,source_o);
  16. };
  17. FPController.prototype.scrollY = function(_sb)
  18. {
  19.    this.broadcastMessage("onScrollY",_sb);
  20. };
  21. FPController.prototype.scrollX = function(_sb)
  22. {
  23.    this.broadcastMessage("onScrollX",_sb);
  24. };
  25. FPController.prototype.printButton = function(_mc)
  26. {
  27.    this.broadcastMessage("onPrint",_mc);
  28. };
  29. FPController.prototype.fitPageButton = function(_mc)
  30. {
  31.    this.view.viewMode = "page";
  32.    this.zoomTo(this.view.pageFitScale);
  33.    this.model.setPage(this.model.currentPage);
  34. };
  35. FPController.prototype.fitWidthButton = function(_mc)
  36. {
  37.    this.view.viewMode = "width";
  38.    this.zoomTo(this.view.pageWidthScale);
  39. };
  40. FPController.prototype.prevPageButton = function(_mc)
  41. {
  42.    if(this.model.currentPage > 1)
  43.    {
  44.       this.model.setPage(this.view.documentView.getTopPage() - 1);
  45.    }
  46. };
  47. FPController.prototype.nextPageButton = function(_mc)
  48. {
  49.    if(this.model.currentPage < this.model.numPages)
  50.    {
  51.       this.model.setPage(this.view.documentView.getScrolledPage() + 1);
  52.    }
  53. };
  54. FPController.prototype.brandButton = function(_mc)
  55. {
  56.    this.broadcastMessage("onBrand",_mc);
  57. };
  58. FPController.prototype.zoomSelect = function(_sld)
  59. {
  60.    if(!this.view.isHandheld && _sld.focused || this.view.isHandheld && !_sld.focused)
  61.    {
  62.       var scaleTo_i = parseInt(_sld.getValue());
  63.       if(!isNaN(scaleTo_i))
  64.       {
  65.          this.view.viewMode = "zoom";
  66.          this.zoomTo(scaleTo_i,_sld);
  67.       }
  68.    }
  69. };
  70. FPController.prototype.popUpWindowButton = function(_mc)
  71. {
  72.    this.broadcastMessage("onPopUpWindow",_mc);
  73. };
  74. FPController.prototype.onKeyUp = function()
  75. {
  76.    this.broadcastMessage("onKeyUp");
  77. };
  78. FPController.prototype.onKeyDown = function()
  79. {
  80.    this.broadcastMessage("onKeyDown");
  81. };
  82. FPController.prototype.onResize = function()
  83. {
  84.    this.broadcastMessage("onResize");
  85. };
  86. FPController.prototype.panOver = function()
  87. {
  88.    this._parent._parent.controller.broadcastMessage("onPanOver");
  89. };
  90. FPController.prototype.panOut = function()
  91. {
  92.    this._parent._parent.controller.broadcastMessage("onPanOut");
  93. };
  94. FPController.prototype.panDown = function()
  95. {
  96.    this._parent._parent.controller.broadcastMessage("onPanDown");
  97. };
  98. FPController.prototype.panUp = function()
  99. {
  100.    this._parent._parent.controller.broadcastMessage("onPanUp");
  101. };
  102. FPController.prototype.panMove = function()
  103. {
  104.    this._parent._parent.controller.broadcastMessage("onPanMove");
  105. };
  106.