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 >
Wrap
Text File
|
2004-09-01
|
3KB
|
106 lines
FPController = function(model_o, view_o)
{
this.model = model_o;
this.view = view_o;
Stage.addListener(this);
Key.addListener(this);
ASBroadcaster.initialize(this);
};
FPController.prototype.zoomTo = function(percent_i, source_o)
{
if(percent_i != this.view.pageFitScale && percent_i != this.view.pageWidthScale)
{
this.view.viewMode = "zoom";
}
this.broadcastMessage("onZoom",percent_i,source_o);
};
FPController.prototype.scrollY = function(_sb)
{
this.broadcastMessage("onScrollY",_sb);
};
FPController.prototype.scrollX = function(_sb)
{
this.broadcastMessage("onScrollX",_sb);
};
FPController.prototype.printButton = function(_mc)
{
this.broadcastMessage("onPrint",_mc);
};
FPController.prototype.fitPageButton = function(_mc)
{
this.view.viewMode = "page";
this.zoomTo(this.view.pageFitScale);
this.model.setPage(this.model.currentPage);
};
FPController.prototype.fitWidthButton = function(_mc)
{
this.view.viewMode = "width";
this.zoomTo(this.view.pageWidthScale);
};
FPController.prototype.prevPageButton = function(_mc)
{
if(this.model.currentPage > 1)
{
this.model.setPage(this.view.documentView.getTopPage() - 1);
}
};
FPController.prototype.nextPageButton = function(_mc)
{
if(this.model.currentPage < this.model.numPages)
{
this.model.setPage(this.view.documentView.getScrolledPage() + 1);
}
};
FPController.prototype.brandButton = function(_mc)
{
this.broadcastMessage("onBrand",_mc);
};
FPController.prototype.zoomSelect = function(_sld)
{
if(!this.view.isHandheld && _sld.focused || this.view.isHandheld && !_sld.focused)
{
var scaleTo_i = parseInt(_sld.getValue());
if(!isNaN(scaleTo_i))
{
this.view.viewMode = "zoom";
this.zoomTo(scaleTo_i,_sld);
}
}
};
FPController.prototype.popUpWindowButton = function(_mc)
{
this.broadcastMessage("onPopUpWindow",_mc);
};
FPController.prototype.onKeyUp = function()
{
this.broadcastMessage("onKeyUp");
};
FPController.prototype.onKeyDown = function()
{
this.broadcastMessage("onKeyDown");
};
FPController.prototype.onResize = function()
{
this.broadcastMessage("onResize");
};
FPController.prototype.panOver = function()
{
this._parent._parent.controller.broadcastMessage("onPanOver");
};
FPController.prototype.panOut = function()
{
this._parent._parent.controller.broadcastMessage("onPanOut");
};
FPController.prototype.panDown = function()
{
this._parent._parent.controller.broadcastMessage("onPanDown");
};
FPController.prototype.panUp = function()
{
this._parent._parent.controller.broadcastMessage("onPanUp");
};
FPController.prototype.panMove = function()
{
this._parent._parent.controller.broadcastMessage("onPanMove");
};