Reference for PageTurn 3D CS

Method

Description

gotoPage() Move to page with specify page number. Start with zero.
nextPage() Move to next page.
prevPage() Move to previous page.
load()Load xml source.
start() Start the book.
stop() Stop the book.
currentPageIndex() Get the id of current page (right spread).
numPage() Get the number of pages.

 

PageTurn3D.gotoPage()

Availability Flash Player 9.

Edition Flash CS3.

Usage PageTurn3D.gotoPage(index)

Parameters

index: index of the page. Start from zero

Returns None

Description Method; Move to page with specify index.

Code Example :

PageTurn3D_mc.gotoPage(10); //goto page with index 10

 

PageTurn3D.nextPage()

Availability Flash Player 9.

Edition Flash CS3.

Usage PageTurn3D.nextPage()

Returns None

Description Method; Move to next page.

Code Example :

PageTurn3D_mc.nextPage();

 

PageTurn3D.prevPage()

Availability Flash Player 9.

Edition Flash CS3.

Usage PageTurn3D.prevPage()

Returns None

Description Method; Move to previous page.

Code Example :

PageTurn3D_mc.prevPage();

 

PageTurn3D.load()

Availability Flash Player 9.

Edition Flash CS3.

Usage PageTurn3D.load(xml)

Parameters

xml: URL of external xml file. Or XML object.

Returns None

Description Method; Load the xml source and setup PageTurn3D

Code Example :

//Load the source xml named books.xml.  
PageTurn3D_mc.load("books.xml");

 

PageTurn3D.start()

Availability Flash Player 9.

Edition Flash CS3.

Usage PageTurn3D.start()

Returns None

Description Method; Start the component if xml is loaded and the component not started yet.

Code Example :

//Load the xml 
PageTurn3D_mc.load("photo.xml");
//Start
PageTurn3D_mc.start();

 

PageTurn3D.stop()

Availability Flash Player 9.

Edition Flash CS3.

Usage PageTurn3D.start()

Returns None

Description Method; Stop the component when the component is in started state.

Code Example :


PageTurn3D_mc.stop();

PageTurn3D.currentPageIndex()

Availability Flash Player 9.

Edition Flash CS3.

Usage PageTurn3D.currentPageIndex()

Returns Number: Current page index. ( right spread )

Description Method; Return the current page index of reight spread.

Code Example :

currentpagenumber = PageTurn3D_mc.currentPageIndex();

 

PageTurn3D.numPage()

Availability Flash Player 9.

Edition Flash CS3.

Usage PageTurn3D.numPage()

Returns Number. The total number of pages of the book.

Description Method; Return the total number of pages.

Code Example :


numberofpage = PageTurn3D_mc.numPage();

To use event, you need to import the library:

import com.digicrafts.events.*;

Event

Object

Description

pageChange PageTurn3DEvent.CHANGE

Broadcast when the book change to a new page.

pageZoomIn PageTurn3DEvent.ZOOM_IN Broadcast when the book is zoomed in and stop.
pageZoomOut PageTurn3DEvent.ZOOM_OUT Broadcast when the book is zoomed out and stop.
completeItemEvent.COMPLETEBroadcast when the all buffer images loaded.


Code Example :

import com.digicrafts.events.*;    
function itemH(event:PageTurn3DEvent):void {
switch(event.type) {
//page change Event
case PageTurn3DEvent.CHANGE:
//do something when mouse over an item
//You can get the item item by
trace(event.index);
//You can get the data object by
trace(event.item);
// You can get parameter inside data object by
trace(event.item.source);
break;
//Zoom in Event
case PageTurn3DEvent.ZOOM_IN:
//do something when the book zoom in
break;
//Zoom out Event
case PageTurn3DEvent.ZOOM_OUT:
//do something when the book zoom out
break;
}
}
book_mc.addEventListener(PageTurn3DEvent.CHANGE,itemH);
book_mc.addEventListener(PageTurn3DEvent.ZOOM_IN,itemH);
book_mc.addEventListener(PageTurn3DEvent.ZOOM_OUT,itemH);

Property

Type

Description

Default Value

Possible Value

dataProvider
DataProvider
Get the DataProvider for the components 
sourceStringThe path to the xml generate by Photoshop Web Gallery Function, Flickr rss or Youtube rss.
photo/photos.xml
url to the xml file
bufferCount Number The number of image buffer before start. ( -1 = Load all images) -1 Positive Number
useThumbnailBooleanDetermine the use of thumbnail image in the xml source as image. truetrue/false
proxyStringThe proxy script for cross domain issue.  url to the proxy script
autostartBooleanEnable auto start when xml and image loaded
true
true/false
itemWidthNumber The width of each page.. This value is the actual value when zoom. 400Positive Number
itemHeightNumber The height of each page. This value is the actual value when zoom. 600Positive Number
cameraAngle Number Angle pan for the camera view 45 0 - 45
cameraZoom Number Set the camera zoom value. 2.4 Positive Number
shadowNumber Enable/disable shadow truetrue/false
transitionTimeNumberThe transition time of the animation. ( in seconds)1 secPositive Number
transitionTypeStringThe transition type of the animation.easeOutSineAny String
keyboardControlEnabledBooleanEnable/Disable the keyboard control.truetrue/false
touchScrollEnabledBooleanEnable/Disable the touch scroll control.truetrue/false
wheelScrollEnabledBooleanEnable/Disable the mouse wheel control.truetrue/false
itemClickActionStringDetermine the action do when mouse click on the items. "ZOOM" "ZOOM"
nextButtonTargetNameStringThe instance name of Button/SimpleButton use to control the move to next item Any instance name of Button/ SimpleButton
prevButtonTargetNameStringThe instance name of Button/SimpleButton use to control the move to previous item Any instance name of Button/ SimpleButton
scrollBarTargetNameStringThe instance name of UIScrollbar/Slider use to control the menu movement Any instance name of Button/ SimpleButton
loaderSkinStringThe class name use of the skin for the loading animation  Any class name of movieclip symbol

Read Only Properties

Property

Type

Description

numPage Number Number of pages.
currentPageIndex Number The selected page id. (Right hand side)
started Boolean Determine about the components if it is started.
length Number Length of the current datasource.
Item Parameter Name Description
1 source The path to the xml generate by Photoshop Web Gallery Function, Flickr rss or Youtube rss.
2 useThumbnail Enable/disable using thumbnail image defined in the xml for image source.
3 autostart Enable auto start when xml and image loaded
4 proxy The proxy script for cross domain issue.
5 bufferCount The number of image buffer before start. ( -1 = Load all images)

 

Item Parameter Name Description
1 itemWidth The prefered width of each page. It is the actual size when zoom.
2 itemHeight The prefered height of each page. It is the actual size when zoom.
3 cameraAngle The angle of view.
4 cameraZoom The zoom level of the camera.
5 hardCover Enable/disable hard cover.
6 itemBaseColor Set the base color of item.

 

 

Item Parameter Name Description
1 itemClickAction This enable item zoom when click on page.
2 transitionType The transition type of the animation.
3 transitionTime The transition time of the animation. ( in seconds)

 

 

Item Parameter Name Description
1 keyboardControlEnabled Enable/Disable the keyboard control.
2 touchScrollEnabled Enable/Disable the touch scroll control.
3 wheelScrollEnabled Enable/Disable the mouse wheel control.
4 nextButtonTargetName The instance name of Button/SimpleButton use to control the move to next item
  prevButtonTargetName The instance name of Button/SimpleButton use to control the move to previous item
6 scrollBarTargetName The instance name of UIScrollbar/Slider use to control the menu movement

 

Item Parameter Name Description
1 shadow Enable/diable shadow effect.
4 loaderSkin The class name use of the skin for the loading animation

 

Item Parameter Name Description
1
-
Load Preset Button
2
-
Save Preset Button