For one of my latest projects, I had to implement a image viewer where the images are laid out like pages in a book, and where you can then flip the pages, also like in a book. Please don’t ask me why in the world anybody thinks that’s a good idea…
Anyway, after fiddling a little with pure Javascript, I abandoned the idea, primarily because it’s close to impossible to achieve the right look without the ability to rotate images. This is where I found the excellent PageFlip by Macc, a Flash file which can be programmed to do exactly what I wanted. However, Flash is not exactly my strong side, so I wanted to be able to customize the pages without generating a new Flash file. Again, I was lucky, because somebody had already modified the Flash file to read images from xml. Sweet. Only one problem left: Styling of prev/next/goto. And this is where I had to do some work myself:
I modified the flash so that it sends out two events, onPageChange and onFlashLoaded, to JavaScript. Combined with SWFObject, it’s possible to control the page flipping entirely through Javascript. I then removed the controls from the Flash file itself, and now I have the completely customizable page flipping solution.
The bonus: You can have it too, or you can just take a look at the demo.
Now I’m off to make a GWT app for creating new configurations based on a PDF file.



