Flex book component (beta)
by Ruben
So here it is, the beta version of my Flex Book component. The source-code is included and free for all of you to look into (mind that it is licenced under a Creative Commons licence).
UPDATE: I also created a simpe demo to demonstrate the simplicity of using the Book classes, you can view/download it here:
Simple demo
Simple demo source
There are still a few performance-optimalisations to be made, so I welcome any (constructive) feedback on the Book component. If you spot any bugs or possibilities for optimalisation then please send me an email (my email-address can be found on the contact-page).
If you have any feedback other than bug-reports and suggestions for optimalisation, then please post them in the comments.
In the next week I will hopefully put up a simple demo as well to point out the simplicity of the usage of the Book component.
FEATURES
These are the main features of the component:
- Pageflip effect (not kidding
) - Hardback option for every page, as well as a hardcover option for the containing book, automatically making the first and last pages hardback.
- Functionality for tearing pages out of the containing book.
- Methods allowing automatically flipping through the pages of a book ( gotopage() ).
- Customizable easing, auto-pageflip duration, and size for the hit-regions (the page-corners whereby a page can be flipped).
- Distortion (instead of skewing) when flipping hardback pages.
- A variety of events that the book class dispatches, making customization alot simpler.
- Transparency support for pages.
- Live-bitmapping functionality for playing animation uninterrupted during pageflips.
- Locking functionality to keep certain pages from being flipped.
CREDITS
- Didier Brun for making his pageflip rendering class.
- Thomas Pfeiffer (aka Kiroukou) for letting me use his distortion class.
- the Factor.e for allowing me to publish the demo and the source-code..
- Maikel Sibbald for helping me with (among a lot of things) thinking out the structure of this component. He also made a usage-example of Didier's pageflip class which I used as reference in the early days of the Book class..
- Theo Aartsma (aka Sumeco) for letting me use his artwork in the Book demo..
After the first (alpha) release of the Book classes, some suggested that I ought to give credit to my sources of inspiration.
So hereby I give credit for inspiration to every book I have ever read in my life, flipping through your pages was just amazing.
If I would have to give inspirational credits to any earlier version of the pageflip effect then I would give credit to the one that Eric Natzke did for DreamWorks, which is the first I ever saw (years and years ago).
KNOWN BUGS AND ISSUES
- For Book instances, height values greater than the height of the content may slow down the application.
- ScrollPolicies for Page instances are disabled (the properties have been overridden and are idle in the Page class). When a Page instance is not being flipped, its fold-gradient is drawn upon a Shape instance stored within that Page its rawChildren. When scrollbars are displayed, the Shape instance will no longer be in place.
- When a Book instance without any children is initialized a RangeError is thrown. I will look into this issue, in the meanwhile you may want to use the following workaround; Put two child Page instances in the Book instance, then (from withinin the creationComplete property of the Book instance) remove the two dummy-children by using the removeChild() method.

Comments (read older or newer, or show 35 trackbacks)
Trackbacks:
..oh and thanks Brad!
Hey Ruben! First of all congrats on the great job! Well done! I may have found a bug though…When adding pages from actionscript, the fold-gradient of the page is gone. Perhaps it’s related to the ScrollPolicy issue that has the same effect when turned on? Thanks.
Code snippet:
…
var page:Page=new Page();
myBook.addChildren(page);
…
[...] Voilà un composant pouvant être utile que nous propose Ruben Swieringa : flex book. [...]
Thanks George, I will look into this issue and try to fix it in the next release..
Great job and beautiful content!
I’ll be sure to use your flip book in some project.
Luv it!
/Petit