ActionScript Reference
pageFlipper.backAlpha
Availability
Flash Player 7
Usage
pageFlipper.backAlpha = State
Parameters
State - Boolean value
Returns
Boolean
Description
Determines if pages will have background color or image.
Example
myPageFlipper.backAlpha = true;
myPageFlipper.restart();
pageFlipper.backColor
Availability
Flash Player 7
Usage
pageFlipper.backColor = Color
Parameters
Color - Color value
Returns
Color
Description
Sets the background page color.
Example
myPageFlipper.backColor = 0xCCCCCC;
myPageFlipper.restart();
pageFlipper.clickSpeed
Availability
Flash Player 7
Usage
pageFlipper.clickSpeed = Speed
Parameters
Speed - Numeric value
Returns
Number
Description
Determines how fast the pages will flip after being clicked.
Example
myPageFlipper.clickSpeed = 2;
myPageFlipper.restart();
pageFlipper.displayOnLoad
Availability
Flash Player 7
Usage
pageFlipper.displayOnLoad = State
Parameters
State - Boolean value
Returns
Boolean
Description
Determines if the pageFlipper should be visible only after all pages have loaded. Default value is 'false'.
Example
myPageFlipper.displayOnLoad = true;
myPageFlipper.restart();
pageFlipper.flipSound
Availability
Flash Player 7
Usage
pageFlipper.flipSound = File
Parameters
File - Path to mp3 or wav file or linkage name or imported sound file
Returns
String
Description
Defines the sound file that will play when the page flips over.
Example
myPageFlipper.flipSound = "mySound.mp3";
myPageFlipper.restart();
Availability
Flash Player 7
Usage
pageFlipper.followSpeed = Speed
Parameters
Speed - Numeric value
Returns
Number
Description
Sets the mouse following speed of the dragged page.
Example
myPageFlipper.followSpeed = 7;
myPageFlipper.restart();
pageFlipper.getLeftPageNum
Availability
Flash Player 7
Usage
pageFlipper.getLeftPageNum()
Parameters
None
Returns
Number
Description
Returns the index number of the page on the left.
Example
myPageFlipper.getLeftPageNum();
pageFlipper.getRightPageNum
Availability
Flash Player 7
Usage
pageFlipper.getRightPageNum()
Parameters
None
Returns
Number
Description
Returns the index number of the page on the right.
Example
myPageFlipper.getRightPageNum();
pageFlipper.getTotalPages
Availability
Flash Player 7
Usage
pageFlipper.getTotalPages()
Parameters
None
Returns
Number
Description
Returns the total number of pages.
Example
myPageFlipper.getTotalPages();
pageFlipper.gotoPage
Availability
Flash Player 7
Usage
pageFlipper.gotoPage(number, boolean)
Parameters
number The index number of the page to be displayed.
boolean (Actionscript 3 only) If set to true, goes directly to page, if false flips through pages.
Returns
Nothing
Description
Automaticaly flips through the pages to the page number specified in the parameter. In Actionscript 3 a second parameter is required to instruct the component whether to go directly to the specified page or not.
Example
Actionscript 2:
myPageFlipper.gotoPage(3);
Actionscript 3:
myPageFlipper.gotoPage(3, true);
pageFlipper.gotoPageDirectly
Availability
Flash Player 7
Usage
pageFlipper.gotoPageDirectly(number)
Parameters
number The index number of the page to be displayed.
Returns
Nothing
Description
Directly goes to the page specified by the index number provided as the parameter, without flipping through all of the pages.
Example
myPageFlipper.gotoPageDirectly(3);
pageFlipper.loaderColor
Availability
Flash Player 7
Usage
pageFlipper.loaderColor = Color
Parameters
Color - Color value
Returns
Color
Description
Sets the loader color.
Example
myPageFlipper.loaderColor = 0xFFFFFF;
myPageFlipper.restart();
pageFlipper.loadOnDemand
Availability
Flash Player 7
Usage
pageFlipper.loadOnDemand = State
Parameters
State - Boolean value
Returns
Boolean
Description
Determines if all pages should start loading immediately or if each page should start loading only after it has opened.
Example
myPageFlipper.loadOnDemand = true;
myPageFlipper.restart();
pageFlipper.loadXML
Availability
Flash Player 7
Usage
pageFlipper.loadXML(xmlFile)
Parameters
xmlFile a path and filename to an external XML file
Returns
Nothing
Description
The path and name of the external XML file to be used if you want to set the content of the component using XML instead of using the parameters panel.
Example
myPageFlipper.loadXML("pflipper.xml");
pageFlipper.numbering
Availability
Flash Player 7
Usage
pageFlipper.numbering = Type
Parameters
Type - String value
Returns
String
Description
Sets the type of numbering that will be applied on all pages. Values can be 'none','all pages','even pages only','odd pages only' or 'pageNumer/totalNumber format'.
Example
myPageFlipper.numbering = "even pages only";
myPageFlipper.restart();
pageFlipper.onFlipStart
Availability
Flash Player 7
Parameters
None
Returns
Nothing
Description
Event called when the page starts flipping.
Example (pageFlipper-AS2)
myPageFlipper.onFlipStart = function() {
// code here
}
Example (pageFlipper-AS3)
function onFlipStart ():void{
// code here
}
pageFlipperInstance.setFlipStartEventHandler(onFlipStart);
pageFlipper.onPageFlip
Availability
Flash Player 7
None
Returns
Nothing
Description
Event called as the page finishes flipping.
Example (pageFlipper-AS2)
myPageFlipper.onPageFlip = function() {
// code here
}
Example (pageFlipper-AS3)
function onPageFlip ():void{
// code here
}
pageFlipperInstance.setPageFlipEventHandler(onPageFlip);
pageFlipper.onPagesLoaded
Availability
Flash Player 7
Parameters
None
Returns
Nothing
Description
Event called once all external pages have loaded.
Example (pageFlipper-AS2)
myPageFlipper.onPagesLoaded = function() {
// code here
}
Example (pageFlipper-AS3)
function onPagesLoaded ():void{
// code here
}
pageFlipperInstance.setPagesLoadedEventHandler(onPagesLoaded);
pageFlipper.overCornerSize
Availability
Flash Player 7
Usage
pageFlipper.overCornerSize = Square size
Parameters
Square size - Numeric value
Returns
Number
Description
Sets the size of onMouseOver detecting corner squares in pixels.
Example
myPageFlipper.overCornerSize = 50;
pageFlipper.pageFolder
Availability
Flash Player 7
Usage
pageFlipper.pageFolder = Folder path
Parameters
Folder path - A path to external files where the component will look for page files
Returns
String
Description
Sets the folder where pageFlipper will look for external page files.
Example
myPageFlipper.pageFolder = "pages/";
myPageFlipper.restart();
pageFlipper.pageHeight
Availability
Flash Player 7
Usage
pageFlipper.pageHeight = Height
Parameters
Height - Numeric value
Returns
Number
Description
Defines the page height.
Example
myPageFlipper.pageHeight = 350;
myPageFlipper.restart();
pageFlipper.pageList
Availability
Flash Player 7
Usage
pageFlipper.pageList = Array
Parameters
Array - Array of library movieclip or external files
Returns
Array
Description
An array of library movieclips or external files that will be imported/loaded and displayed as pages.
Example
myPageFlipper.pageList = ['page1.jpg','page2.jpg','page3.jpg','page4.jpg'];
pageFlipper.pageOrder
Availability
Flash Player 7
Usage
pageFlipper.pageOrder = Type
Parameters
Type - String value
Returns
String
Description
Defines the order of pages displayed. Values can be 'first to last' or 'last to first'.
Example
myPageFlipper.pageOrder = "last to first";
pageFlipper.pageWidth
Availability
Flash Player 7
Usage
pageFlipper.pageWidth = Width
Parameters
Width - Numeric value
Returns
Number
Description
Defines the page width.
Example
myPageFlipper.pageWidth = 270;
pageFlipper.restart
Availability
Flash Player 7
Usage
pageFlipper.restart()
Parameters
None
Returns
Nothing
Description
Restarts the component and applies the previously defined or default properties. This method must be called after changing any property via ActionScript in order for the newly defined properties to function properly.
Example
Here is the example of attaching the component from the library, configuring and initalizing it only through ActionScript:
attachMovie("pageFlipper","pFlipper",_root.getNextHighestDepth());
pFlipper.pageList = ['page_1','page_2','page_3'];
pFlipper.pageHeight = 400;
pFlipper.pageWidth = 300;
pFlipper.Scale2Fit = true;
pFlipper.startPage = 2;
pFlipper.restart();
pageFlipper.Scale2Fit
Availability
Flash Player 7
Usage
pageFlipper.Scale2Fit = State
Parameters
State - Boolean value
Returns
Boolean
Description
Scales the pages so that they fit the specified page size.
Example
myPageFlipper.Scale2Fit = true;
pageFlipper.shadowStrength
Availability
Flash Player 7
Usage
pageFlipper.shadowStrength = Depth
Parameters
Depth - Numeric value
Returns
Number
Description
Defines the strength of the shadows that are applied while flipping the pages.
Example
myPageFlipper.shadowStrength = 70;
pageFlipper.startPage
Availability
Flash Player 7
Usage
pageFlipper.startPage = Page Number
Parameters
Page Number - Numeric value
Returns
Number
Description
Sets the initial number of page that will be displayed upon start.
Example
myPageFlipper.startPage = 1;