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:
Thanks for the great work and making it available.
What I would love to see is the ability to see the edges of pages that are beneath the current ones. (perhaps even clickable so you can jump to anyplace in the book – tabs would be an even neater addition!) This gives you an intuitive feel for where you are in the book. It would also be great to make it simple to add a sound effect for the page turn.
Allowing for a slight downwards perspective would also help to emulate the real thing. Much like reading a book on a table. This would make it easier to see the overall page position and book thickness.
I maybe adding these features myself if I get some time. If I do I will pass the code on to you.
Would it be possible to animate a transition when the hard cover property is changed? It’s not major, but it would be a nice addition.
@Rick:
quote from Rick:
quote from Rick:
That would indeed give the Book a whole new look-and-feel. However, I predict that implementing the feature you’re describing may prove to be a real bitch.
As far as the tabs go you will already be able to do this by reading the pages property of the Book class, and using its gotoPage() method..
In the meanwhile, be sure to hit me up if you get the implementation of these features done without making the code too messy or cpu-intensive..
quote from Rick:
Use the pageTurned-event and play the sound from within the event-listener. That’s pretty simple, right?
@Brad:
quote from Brad Beattie:
Actually that would be a really nice feature, I will think about implementing it, thanks!
Hi, this is a marvelous creation you have here. I am a genealogist and would love to be able to put scanned images of books with this instead of having to go from link to link to see an image. Also images of records ie marriage certicate / death cert / photos etc.. Then being able to print the pages for us would be great.
How does someone who knows nothing of this type of work change the images etc for my use? I do basic webpages but that is the extent of it.
Thanks for such an awesome program.
smiles to you!
[...] an amazing and fully functioning flex application using Didier’s PageFlip class. Check it out Here. Pretty solid and feature rich, and it’s available for use. Kudos to him. However, if you are [...]