This page contains information about how to set up the PageFlip, how to create the content, and customizing. All the XML properties are detailed. Please read it carefully before setting up a new book. If something is not covered by this documentation, please let us know.
Documentation for the previous version PageFlip 3.5
XML configuration for the version PageFlip 3.4
PageFlip documentation writing still in progress!
added Background and ControlBar button colour setup to XML
totally rewritten Thumbnail scripts including display, layout, scaling, and thumbnail loading
added Always Opened feature
added support for odd number of pages
added page number display in Thumbnail mode
added ZoomFile/PrintFile to XML to control zooming/printing independently
added VerticalMode feature
added Page Offset parameter
added CopyrightText attribute to the XML language elements, no need to edit .fla anymore
added PageName feature (Pages can have names instead of a number, and the number of the page can be changed also)
added ZoomToTop switch (In Dragzoom mode the top of the zoom image is displayed first)
fixed zoom window
fixed zoom image position when resizing the Stage while zooming
fixed hotspot in zoom mode
added fullscreen button
added multipage TOC support
added optional data to each page, which id defined in XML and can be accessed from the page's script.
Review all changes made to PageFlip in the version history
Download the sample XML file. (IE/FF: Right click > save link as - Safari: alt click)
First set the PageWidth/PageHeight (in pixels) in the XML file, then make your page files using the same dimensions. Save them in jpg/gif/png or swf format. Set the filenames in XML to each page.
You are ready to start PageFlip.
To meet all the features and possibilities with PageFlip, read the detailed description below.
PageFlip is an application that simulates a book on your screen, let you flip pages by dragging them, or by using control buttons. Usually it is used online, embedded into a website, to present book-like content.
As PageFlip is an Adobe Flash application, written in ActionScrip 2.0 language, it have all the advantages of a Flash document, every page content can be not only a graphic symbol (picture, static vector based shapes) but an animation (frame by frame, or scripted) or interactive flash content (forms, sound/videoplayer, any flash application).
In addition PageFlip have many features that can help browsing and building content.
Event handlers are for adding special script to control content management, or to add visual/audio effects.
Before building a PageFlip, it is important to know what features would you like to use. The size of the pages, its format, the need of the thumbnail or zoom files, all depends on what you set up in XML.
PageFlip is composed of page files. They could be jpg, gif (non animated), png or swf files. Image files are for static content, the best performance of the flip animation speed is achieved by using image files. (You can make transparent page not only by swf, but by using png format, and still keep the advantage of using an image file)
Swf files are treated specially, because they are special. They are scalable, they can be animated and scripted.
It is recommended to add the following script to each page's root:
function reset(onTop, active) {
//custom script here
}
Custom scripts have to control
The variable onTop
is true only when the page is on the top of all other. Buttons have to be enabled only in this case.
active
is true, when the page is visible, but not on top (when the top page is transparent, or in thumbnail mode). It have to control animation on the page.
If you want to use the same swf file for the normal page view, and for the zoom view too, or you would like to use AutoSize feature, then you have to define some variables on the same level as the previous script, on the root of the page file:
// used for autosize;
pageWidth = 330;
pageHeight = 380;
// if used as zoom file, use these size parameters
zoomWidth = 660;
zoomHeight = 760;
zoomScale = 200;
The values for AutoSize tells the script how big is the loaded page's original size. Values for zoom tells the PageFlip how many it have to enlarge the content.
The PageFlip package contains a page template source file (Source/pages/template_page.fla) which contains all these functions and variables predefined. You just need to set values for the variables that match you setup.
LiveThumbnails
is set to "true"
in the XML file, you don't need to make thumbnail files, as they are scaled down from the page file.
Otherwise, the thumbnail files have to be the scaled down copy of the original page content.Enable Transparency in the XML file (Transparency="true"), to be able to use transparent content. This enables a one level page transparency, that means you can view through the page, you can view the page overlaid, but not the next. Only 1 layer is rendered in addition. This is for best performance, too much page content rendering can slow down the flow of the flip control.
If you don't want to use transparent pages, set this attribute to false (Transparency="false"). Rendering will be smoother this way.
Pages can be rendered like "hard" book covers. 3 attributes controls this option:
Hardcover
(Settings' attribute)
"false"
to use "soft" cover (default value)."true"
to render "hard" book cover.Hardpage
(Settings' attribute)
"false"
to use "soft" pages (default value)."true"
to render inside pages as "hard" page.HardPage
(PageOrder/PageData's attribute)
"true"
to render that page as "hard" page (default false).As all hard-covered book's cover larger than the inside pages, PageFlip let you the option to use Larger cover pages. This feature works correctly only if you enabled Hardcover.
The following attributes are for setting up PageFlip's "Large"cover:
LargeCover
(Settings' attribute)
LargeCover="true"
, default false).LargeCoverTopOversize
(Settings' attribute)
LargeCoverSideOversize
(Settings' attribute)
Pages can be scaled up/down as the stage is resized. The zoom-page viewer area and the Thumbnails area are also scaled if this option is enabled (PageScale="true", default false).
The scaling is done by the following way:
PageFlip is rendered at 100% (with the page size set in the XML) only when it is displayed with same Stage size (at embed level in html, or in Flash Player) as it is defined in XML in BaseStageWidth
and BaseStageHeight
attributes. When the stage is resized, PageFlip fits itself inside the space left. Space left means, the Stage.height - DefaultControlHeight
. DefaultControlHeight
is set in pageflip_loader.fla, and it is the Height of the control-bar in pixels.
Thumbnails are displayed only if ThumbnailsEnabled
(Settings' attribute) is set to true (ThumbnailsEnabled="true"
)
LiveThumbnails
means, that the thumbnail images of the pages are the pages itself, just resized. All pages are shown exactly as they appears in the book. With ThumbnailsActivePages
enabled (ThumbnailsActivePages="true"
, default false) animation are rendered too. LiveThumbnails
are rendered on stage so they fit the book's area, like they are sit on a spread.
Disable LiveThumbnails
(LiveThumbnails="false"
, default true) to allow pageflip to load pre-saved thumbnail pages. They will be displayed with predefined fixed size, and they won't be never scaled.
The size of the loaded thumbnail images must be set (only if LiveThumbnails
is enabled) in ThumbnailWidth
/ThumbnailHeight
(Settings' attribute).
ThumbnailPadding
(Settings' attribute)
ThumbnailBorderWidth
(Settings' attribute)
ThumbnailBorderColor
(Settings' attribute)
"0x333333"
, Hexadecimal RGB value).ThumbnailBorderHoverColor
(Settings' attribute)
HotSpots are used to make special buttons on the page. They are purely defined in XML. HotSpots are invisible Shapes on the page, which displays a popup message (also set in XML) on mouse over, and can be set up to open a webpage in the browser, or to go to any page in the book.
Each page can have its own HotSpot XML file, defined in HotspotData
(an optional attribute of PageOrder/PageData). Assign it the file which contains the HotSpot definitions for that page (HotspotData="pages/page1hotspot.xml"
).
HotSpots are defined in an XML file. Each page with HotSpots on it, have its own HotSpot data file. The root node is HotSpotData
, it contains the HotSpot definitions, each within a HotSpot
childnode, which have these attributes to set up a HotSpot:
Shape
(HotSpot's attribute)
Shape="x1,y1/x2,y2/x3,y3/xn,yn"
PopupTitle
(HotSpot's attribute)
PopupTitle="Your Title"
PopupText
(HotSpot's attribute)
PopupText="Your message"
TargetLabel
(HotSpot's attribute)
TargetLabel="YourLabel"
Skip
(HotSpot's attribute)
Skip="true"
Link
(HotSpot's attribute)
Link="http://pageflip.hu"
Use the original HotSpot XML file as template.
PageFlip have built in pageflip sounds, that can be controlled from XML. You can enable/disable PageFlip sounds (Sounds Enabled="true"/"false", default false), you can set up the flipping sound level from 0-100 (EffectVolume="100", default 25), and you can set custom mp3 files for 3 event: Start flip, End flip (sounds when mouse is released) and for TearOff.
The size of your page depends on the usage of the book:
AutoSize="true"
in the XML file, the page will be resized to the predefined size.It is important, that if you already know the page size, you have to set the BaseStageWidth
and BaseStageHeight
values in XML so the pages will have enough space to fit on the Stage. You have you have to be care about to embed pageflip_loader.swf with the same size to view pages at 100%. Otherwise, if PageScale is enabled, and the embedded Movie's size is not the same as BaseStageWidth/BaseStageHeight, the PageFlip will be scaled.
BaseStageWidth
/BaseStageHeight
is used to calculate the scaling factor of the book. These variables and the Stage size must be large enough to display the book and the controls on the Stage without cropping.
Example:
If you want to use 400x600 sized pages, your book will be 800x600, add then the controlbar height -> 800x660, and add some space at the top and bottom of the book -> 800x800
Set your Stage size to 800x800 pixels (this step can be skipped if you embed PageFlip into html)
Set these attributes in XML:BaseStageWidth="800"
BaseStageHeight="800"
Set your Movie size in the embed scripts in html (this step can be skipped if run PageFlip in StandAlone Flash Player)
Now your pages will be displayed as espected.
Page files must be made using the dimensions set in XML (PageWidth
/PageHeight
Settings' attributes), except if you enable AutoSize
option in XML (AutoSize
Settings' attribute, default true), but better is the quality with matching size.
Buttons on the page
Making buttons needs a bit more attention than non-clickable objects. If transparency is enabled/used, a page can still visible even if it isn't on top. if there are buttons on the page, they will be clickable through the transperent page, and trigger the page below. In addition, if ZoomOnPageClick
feature is enabled (ZoomOnPageClick="true"
, default false), zooming must be disabled if a button is hovered. To fix these issues, a short script must be added to the page's root to control buttons:
function reset(onTop,active) {
button1.enabled = onTop;
button2.enabled = onTop;
//etc.
}
//for each button:
//needed only if ZoomOnPageClick feature is enabled
button1.onRollOver = function () {
pfroot.overbutton = true;
}
button1.onRollOut = button1.onDragOut = function () {
pfroot.overbutton = false;
}
button1.onRelease = function () {
pfroot.overbutton = false;
}
//etc.
Please note, that if you have already defined a reset function, just add the script enclosed by the braces to the existing reset function.
Animation/Sound/Video on the page
Animations, Sound and Video playback are also controlled by the reset function. If a page is not visible, the animation or playback on it must be paused, and resumed when it become visible again. To control it, add this script inside the existing reset function:if(onTop|active) {
//play script
} else {
//pause script
}
Embedded pages
Page files can be embedded in pageflip_v36.fla. Make your own page MovieClip, then export it using the library's linkage setting (export it to the first frame). The Export Name have to be used to reference this page in the XML file:
PageFile="embedded:yourPageMC"
Use prefix: "embedded:" in any PageFile and LargeFile to tell the script that the content is embedded. (Thumbnails can't be embedded, use LiveThumbnails)
DragZoom="true"
, default false) or by mouse movement over the page. The size of the area where zoom pages are loaded can be changed also (if PageScale is enablet it will be scaled like the book), that is important if you change the Stage size.
LiveThumbnails
option is disabled, each page must have an associated thumbnail file, they will be loaded when the thumbnail button is pressed first. They are fixed sized. If PageScale
is enabled, the thumbnail won't re-scaled, but they will be rearranged to fit the available space on the stage.
There is three variables in pageflip_loader.fla root script:
var ControlBarVisible = true;
if don't need the control bar, set it to false
var ControlBarPosition = "BOTTOM";
or "TOP": sets the position of the control bar
var DefaultControlHeight = 60;
defines the control bar height. Needed for properly display PageFlip.
Location of the customisable items: pageflip_loader.fla -> library -> Customisable items
Symbols name ending with _btn are the button MovieClips, each with (except autoflip) 3 frames -> normal/hovered/pressed.
ctrl is the layout MovieClip. Make attention of the script in that MovieClip, it controls the functionality of the buttons. If you change the buttons, its MovieClip must have the same instance name as it has originally.
If the pages are not correctly fit on the stage, you have to set BaseStageWidth
and BaseStageHeight
attributes in the XML file matching with the size of the pageflip_loader.fla document's Stage. The control-bar and the pages will be placed automatically.
Copy and paste the Pageflip Loader MovieClip from the pageflip_loader.fla's library to your own Movie (in this case, page scaling won't work correctly).
The Dynamic PageFlip 3.5 uses an XML configuration file to store preferences and content information. This XML file can be edited with a text editor (not word processor!) like TextEdit/TextWrangler/NotePad or can be generated by a server-side script.
The XML filename can be set in Pageflip Loader MovieClip in the library of pageflip_loader.fla.
Save PageFlip files (XML file included) into the same folder as the pageflip_loader.swf, or in a sub-folder of that folder
The first part of the XML configuration file, used to configure the book.
ZoomOnPageClick means that a simple click on the page switch to zoom view.
LightBoxZoom set to "true" enables zoom images view with LightBox (no swf support).
If ZoomActivePage is "true", animations on the zoomed page will be active.
If DragZoom is "true" the zoomed page can moved by dragging it.
ZoomToTop show the top of the page when entering zoom view.
ZoomHotspot enables HotSpots used on the original page in zoom view.
PageFlip sounds are controlled by the following attributes:
The second part of the XML configuration file. Pages are defined in this section. Each page is defined in a pagedata
tag, and have the following attributes:
This part is optional, it helps you build a table of content, that can be accessed from any page of the book. Each TOC item is defined in a Link
tag, and have the following attributes:
This part is optional, it can change all text displayed by PageFlip:
PagerText="Page #"
, but if set to "#. oldal"
then it will display "22-23. oldal"To get most of the PageFlip's power, you certainly will need access to functions and event handlers. Here is a short list of available functions and their syntax:
The following functions can be used to control PageFlip (to access these functions from the page file's script, use pfroot global variable as prefix).
true
or false
(default false). If true, gotoPage goes to the target page with one flip, if false (or not defined) all page will be flipped until reaching the target page.true
or false
(default false).pfroot.gotoPage(9999);
function call.The following functions can be used to control PageFlip (to access these functions from the page file's script, use pfroot global variable as prefix).
currentPage = pfroot.page;
).If you still need help on PageFlip set up, or you think this page is not informative enough, please contact us.