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. |
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
Availability Flash Player 9.
Edition Flash CS3.
Usage PageTurn3D.nextPage()
Returns None
Description Method; Move to next page.
Code Example :
PageTurn3D_mc.nextPage();
Availability Flash Player 9.
Edition Flash CS3.
Usage PageTurn3D.prevPage()
Returns None
Description Method; Move to previous page.
Code Example :
PageTurn3D_mc.prevPage();
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");
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();
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();
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();
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. |
complete | ItemEvent.COMPLETE | Broadcast 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 | ||
source | String | The 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 |
useThumbnail | Boolean | Determine the use of thumbnail image in the xml source as image. | true | true/false |
proxy | String | The proxy script for cross domain issue. | url to the proxy script | |
autostart | Boolean | Enable auto start when xml and image loaded | true | true/false |
itemWidth | Number | The width of each page.. This value is the actual value when zoom. | 400 | Positive Number |
itemHeight | Number | The height of each page. This value is the actual value when zoom. | 600 | Positive Number |
cameraAngle | Number | Angle pan for the camera view | 45 | 0 - 45 |
cameraZoom | Number | Set the camera zoom value. | 2.4 | Positive Number |
shadow | Number | Enable/disable shadow | true | true/false |
transitionTime | Number | The transition time of the animation. ( in seconds) | 1 sec | Positive Number |
transitionType | String | The transition type of the animation. | easeOutSine | Any String |
keyboardControlEnabled | Boolean | Enable/Disable the keyboard control. | true | true/false |
touchScrollEnabled | Boolean | Enable/Disable the touch scroll control. | true | true/false |
wheelScrollEnabled | Boolean | Enable/Disable the mouse wheel control. | true | true/false |
itemClickAction | String | Determine the action do when mouse click on the items. | "ZOOM" | "ZOOM" |
nextButtonTargetName | String | The instance name of Button/SimpleButton use to control the move to next item | Any instance name of Button/ SimpleButton | |
prevButtonTargetName | String | The instance name of Button/SimpleButton use to control the move to previous item | Any instance name of Button/ SimpleButton | |
scrollBarTargetName | String | The instance name of UIScrollbar/Slider use to control the menu movement | Any instance name of Button/ SimpleButton | |
loaderSkin | String | The 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. |
|
|
|
|
|
|