From MegaZine3
Jump to: navigation, search

A page defines a single page side of a physical page. It holds elements defining the page side's content. Page sides may override some settings from their containing chapter, such as the background color.


Display-related setting allowbmpcaching

  • Type: Boolean
  • Default: false

Try setting this to false when encountering pink pages. If set to 'true' pages can be cached as bitmap images.

Display-related setting bgcolor

The background color for this page. This refers to the base color a page has, if there are no elements on the page obscuring the actual page itself.

Can be an ARGB or RGB value. While the number may be in any format parseable by ActionScript, it is recommended for readability's sake to use a hexadecimal formatted value. Hexadecimal values are marked by prefixing them with 0x.

A value of 0x000000 (or just 0) is transparent, not black. If you want black, use 0xFF000000, i.e. use the ARGB format (alpha-red-green-blue) instead of RGB (red-green-blue).

Note that using many transparent pages next to each other, causing a deep level of transparency and thus many visible pages, can reduce performance significantly (and is therefore not recommended on a book or chapter level).

Display-related setting bgopaque

  • Type: Boolean
  • Default: false
  • Version: 2.0.11

Whether to treat this page as opaque when determining page visibility, regardless of the bgcolor.

This can be useful when pages share the same "mask", i.e. the same areas are visible, but parts of the page are transparent. A practical example of this is a book where pages have rounded corners. All pages have the same shape, so no visual glitches will happen if the not-topmost-pages are hidden, even though the topmost page will have a transparent background.

Why would you want to use this? Performance will be noticeably better if the unnecessary pages are hidden.

Behavior-related setting dragarea

  • Type: String
  • Default: top,middle,bottom
  • Overrides: chapter@dragarea
  • Version: 2.0.10

A comma separated list of the areas which should be clickable by the user to trigger page turns or drags.

The top and bottom areas are the top and bottom page corners, being squares of the size dragrange x dragrange. The middle is the remaining space between those squares, with a width of dragrange.

Behavior-related setting dragrange

The distance to the border inside which auto dragging starts (when the user moves the cursor near a corner), and clicking triggers a page turn or drag.

Display-related setting edgecolor

The color used when painting a page's edge for the book edges. This defaults to the bgcolor of the page itself.

Display-related setting buffer

  • Type: Boolean
  • Default: false

Determines whether to create a static copy of the page's content while turning or dragging the page. This means that no content of the page will be animated while the page itself is moving (e.g. animations in loaded swfs). On the other hand performance will greatly increase for complex SWFs with many animated elements or vector graphics. As soon as the page's movement finishes the content's animation will be displayed again.

Note: right sides of spreadpages will always be buffered while turning either the left or right side of the spreadpage.

Quality difference when using anti aliasing or not.

Display-related setting buffer_aa

  • Type: Boolean
  • Default: false

Determines whether the buffer should use anti aliasing (smoothing). This can result in noticeably improved quality of the video while dragging a page or zooming. Can have a high impact on performance, though.

Display-related setting buffer_animate

  • Type: Boolean
  • Default: false

Only used when buffer is set to true (or if the page is the right part of a spreadpage, which implicates it).

Determines if the content should be animated while the page is being buffered (i.e. turned). This can be useful when having videos or other dynamic content on pages.

Note: has a strong impact on performance. It is not recommended to use multiple pages with animated buffers next to each other, when there is a chance they will all be flipped at once by the user.

The folding effect in the middle of two pages.

Display-related setting foldfx

The alpha value of folding effects for this pages. If set to 0 folding effects are turned off, 1 means 100% opaque. Folding effects refer to a shadow inbetween two pages, simulating a curvature of the pages.

Display-related setting height

The height of this page.

The restriction for custom page sizes is, that they have to be smaller (or the same size) as defined in the book tag.

Display-related setting lighting

  • Type: string
  • Default: shadows, highlights

allows a more finegrained control of which „light“ effects to use on pages: highlights and / or shadows, or neither. Default is „shadows, highlights“. Can be set the whole book and individually for pages also.

Difference of rendering with or without shadows and highlights.

Display-related setting shadows

The intensity of the shadow and highlight effects while turning or dragging the page. The value is the intensity, higher is stronger. If set to 0 shadow and highlight are turned off, 1 means 100% strength.

This is what gives pages "depth" when dragging / turning them, so it is not recommended to turn this off.

Display-related setting spread

  • Type: Boolean
  • Default: false

Allows the definition of spreadPages, i.e. double pages where all content is defined in one page. This allows easier creation of pages where one image spreads both sides and even the use of dynamic content on the whole area. For example, this way one can use the space of two pages to display a video.

For proper functionality, this attribute has to be set on both sides, i.e. on one even and on one odd page side.

Important: all content must be defined on the left side of the double page.

Note: it is not recommended to use this attribute directly. Instead, for an easier way of using spreadpages, have a look at the spreadpage tag, which can be used instead of a page tag.

Display-related setting stiffskew

This controls the tilt of stiff pages, where lower values lead to a "flatter" turn, higher values to a "steeper" one.

Page animation of a stiff page.

Display-related setting stiff

  • Type: Boolean
  • Default: false

If true, this page (together with it's other side) will be a stiff page, resulting in a different turning animation, which resembles that of a hardcover's cover. Only has to be defined in one page of the affected "physical" page. Stiff pages cannot have folding effects.

Display-related setting thumbstatic

  • Type: Boolean
  • Default: false

Allows to control whether page thumbnails should be dynamic or static. Per default, thumbnails are rerendered each frame, in case the page content changed. This is useful, e.g. when the page contains videos or other animated content.

When set to true, the thumbnail will only be rendered once, when the page content finished loading. If the thumbpath attribute is set, the thumbnail will be generated from the loaded image, and the actual page content will never be rendered into the thumbnail.

This attribute's value overwrites the book value book@thumbstatic.

Display-related setting turningenabled

  • Type: Boolean
  • Default: true

If false, this page cannot be turned backwards (in case of a left page) or turned forward (in case of a right page). The page with the attribute set to false acts as a 'blocking page', i.e. it is not possible to go to a page before (if the attribute turningenabled is added on the left page and set to false) or after that page (if the turningenabled attribute is located on a right page and set to false). Not even a direct jump, neither via an API call nor using the GUI (page "knobs"/bubbles in the navigation bar), past such page is possible.

Practical examples are to keep a book always open (for this the attribute must be included on the second and the second last page), or to block an area of the book before the user performed some action (filled out a form, solved a quiz, ...)

Display-related setting width

The width of this page.

The restriction for custom page sizes is, that they have to be smaller (or the same size) as defined in the book tag.

Child Nodes

A page can contain any number of elements. Those will all be positioned absolutely. The element defined last (i.e. the lowest most entry in the XML node) will be displayed top most.

MegaZine3 Core-related articles
Book elements Book · Chapter · Page · Spreadpage
Page elements Area · GIF · Image · Navigation · Sound · Text · Video