Introduction:
The fpwrapper_2.swf acts as a "communication layer" between Authorware and a FlashPaper version 2.0 document. The Flash Asset Xtra for Authorware does not provide a way to directly call flash functions so we use the Xtra's setVariable and getVariable functions to make the FlashPaper 2.0 API calls possible.
Functions:
When implementing the communication layer set the flash variable 'awToSwf' to one of the following values:
getViewerType()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
getViewerVersion()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
getCurrentPage()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to true if the call is successfully relayed to the FlashPaper document.
setCurrentPage(pageNum)
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to true if the call is successfully relayed to the FlashPaper document.
getNumberOfPages()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
getLoadedPages()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
showUIElement(part, flag)
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to true if the call is successfully relayed to the FlashPaper document.
printTheDocument()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to true if the call is successfully relayed to the FlashPaper document.
setCurrentZoom(percent)
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to true if the call is successfully relayed to the FlashPaper document.
getCurrentZoom()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentationfor a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
setSize(w,h)
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentation for a complete description). Sets the Flash variable 'swfToAw' to true if the call is successfully relayed to the FlashPaper document.
Note: It is not recommended to call this function directly as the FlashPaper document is by default set to the same dimensions as the Authorware Flash sprite when loaded. To change the size of the FlashPaper document adjust the size of the Flash sprite instead.
goToLinkTarget(linktarget, window)
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentationfor a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
enableScrolling(flag)
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentationfor a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
getCurrentTool()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentationfor a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
SetCurrentTool(tool)
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentationfor a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
getSidebarWidth()
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentationfor a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
setSidebarWidth(W)
Wrappper for the FlashPaper 2.0 API function of the same name (see the FlashPaper documentationfor a complete description). Sets the Flash variable 'swfToAw' to the value returned from the FlashPaper 2.0 API function.
setFpaperFilename(filename)
Loads the Flashpaper 2.0 document specified in filename into a movie clip in the fpwrapper.swf. Returns true if called successfully.
Events:
The communication layer also generates Sprite Events when the following events occur (create an Authorware Event Response to trap them):
#loadcomplete
The FlashPaper document has finished loading.
#pagechange
The FlashPaper page number has changed.
#zoomchanged
The FlashPaper zoom level has changed.
#visibleareachange
Any aspect of the visible area of the document has changed, including zoom level and scroll position..
#enablescrollchange
Scrolling has been enabled or disabled (typically generated by a call to enableScrolling() )
Reference:
FlashPaper 2.0 API documentation:
http://www.macromedia.com/support/documentation/en/flashpaper/2/flashpaper_api/