Print2Flash Document API Events

Below is the description of each Print2Flash Document Application Programming
Interface event.
| Event Name |
Parameters |
Comments |
| onPageChanged |
page |
Broadcast when the current page
(as displayed in the toolbar) changes. The new page number is passed in page
parameter. |
|
onPageLoaded |
page |
Broadcast when the page
specified by the page parameter is loaded. |
|
onZoomChanged |
zoom |
Broadcast when the current zoom
level (as displayed in the toolbar) changes. The new zoom level is passed in
zoom parameter. |
| onSelection |
selectionRange |
Broadcast when the current text
selection in the document changes. The information on new selection is
passed in selectionRange parameter of
SelectionRange type. To get the selected text use
getSelectedText
function. |
| onToolChanged |
tool |
Broadcast when the currently
active tool (as displayed in the toolbar) changes. The new tool is passed in
tool parameter and represented by text as in
getCurrentTool
function. |
| onVisibleAreaChanged |
visibleArea |
Broadcast when any aspect of the
visible area of the document changes, including zoom level, rotation and
scroll position. The object describing the new visible area of the
document is passed in visibleArea parameter of
VisibleArea type.
|
| onPrinted |
none |
Broadcast when user makes an
attempt to print the document. Note that this event is fired regardless of
the fact if the user proceeded with printing or cancelled it. |
Each handlers of Print2Flash Document API events used in
Flash or
other applications are
passed an additional first argument describing the sender of the event so that
the actual event handler signature for these applications is one argument
longer. For example, onPageChanged event handler in Flash should be declared
like this:
function onPageChanged(sender, page)
If you use Print2Flash Document API
from Flash, the sender parameter is equal to the Print2Flash document movie
instance as returned from
LoadPrint2FlashDoc
function or passed to onLoaded
function.
If you use Print2Flash
Document API from other applications, the sender parameter is equal to the
external name of the movie as it is passed in extName variable in FlashVars
parameter of the Flash movie. If you use the web page HTML code generated by
Save As HTML command
of Print2Flash, this name is specified in name variable in the code like this:
var name="MyDoc"
|