Home

Downloads

FAQs

Sample Book

Features

Forum

 

ActionScript

You can use ActionScript 2.0 within your SWF pages to provide more control of interactivity or just for animations and embedded videos.

Your page will be a child movie clip of pageflip so access to the methods & variables in the pagflip timeline are best accessed by prefixing with _root.

Func/var Type Comment
_root.page var current lefthand page number. This is a zero based index so for the front cover this would return zero.
_root.maxpage var maximum page number - again zero based. So for a book of 30 pages this would be 29.
_root.pages movieclip container for the pages. Zooming the page on screen is done using _root.pages._xscale=_root.pages._yscale=120 to scale it to 120%
_root.gotoPage(page,fastflip) func fastflip should be true or false. true causes gotoPage() to go direct without auto flipping.
_root.gotoPageId(pageId,fastflip) func pageId is a text Id for a page. This is better than using numbers because if you add/remove pages during development the pageId will not change.
_root.setPages(Left,0,0,Right) func Not really intended for user consumption but you may see it exposed in some places (pageNav.as for example).
_root.Zoom.Showclip(Obj) func creates a popup

_root.DoTransition(mc, transitionId, direction, callback)

func

Applies a transition (transitionId) to a movieclip (mc). The tranition direction is iether Transition.IN or Transition.OUT. The callback function is called when the transition finishes.
_root.removeML() func removes the mouse listener - necessary if you load pageflip into another Flash movie.

arrays per page - beware, if pages are torn out the page index changes

_root.pageParam[pg]["key"] array returns the parameter value for "key" for page pg.
_root.pageOrder array returns the src path for page pg.
_root.pageCanTear array returns true or false.
_root.pageSpread array returns true or false.
_root.pageAfterTear array holds the name of a function to execute and upto 5 parameters to pass when a page is torn out.
_root.pageCanBckFlip array returns true or false.
_root.pageCanFwdFlip array returns true or false.
_root.pageId array returns the page Id for the page.
_root.pageText array returns the page keywords.
_root.pageAudio[pg] array of objects

List of page AudioTrack objects.

_root.pageHires[pg] array hires source path for a page
_root.pageHotspot[pg][hs] array of arrays of objects

List of page hotspots.

_root.pageParam[pg]['key'] array of arrays of objects

Lists parameters per page. Each parameter is an object.

_root.pageThumb[pg] array paths to thumbnails for each page
_root.pageBkgnd[pg] array path to background image for each page.
_root.pageNote[pg][note] array of arrays of note objects each object holds details of a page note

Misc arrays - not per page

_root.Tooltips[tt] array of tooltip objects each object holds tooltip info.
_root.Transitions['id'] array of objects Holds parameters for transitions
_root.Filters['id'] array of objects Holds parameters for filters.
_root.backgrounds['id'] array of strings returns path to background image referenced by id.