Multiple PageFlip Books in a File
Since a few people have asked me to help them add multiple PageFlip effects to a single Flash file I thought I’d write this tutorial just for them.
As usual, I recommend downloading the latest version of the Free Flash PageFlip File to be sure we’re on the same page (so to speak).
There are three essential steps to setting everything up for multiple PageFlips. Our first step will be to replace the literal string reference to “print” with a variable named “printID”. The second step will show you how to specify different Linkage Identifiers for the content of each PageFlip. The third and last step explains how to add new content to the Library so it can be accessed with the new Linkage Identifier.
Replace “print” with a variable:
- Click on frame #11 of the “Pages” layer.
- Double-click the highlighted movieclip in the center of the stage to begin editing the Prints clip.
- Click on frame #1 of the Actions layer in the Pages movieclip.
- Open the Actions panel if it’s not already visible (Menu»Window»Actions).
- Click the magnifying glass icon in the top left corner of the Actions panel to access the “Find and Replace” feature.
- Type “print” (with quotes) in the Find field, type “printID” (without quotes) in the Replace field and make sure the “Match case” option is checked. Your Find and Replace window should look something like this:
- Replace all 4 occurrences of (“print”) with (printID) and then close the Find & Replace window.
Once you’ve finished editing the Pages movieclip you need to return to the Main timeline (“Scene 1” or “_root”) by double-clicking a blank area on the stage or by clicking the “Scene 1” button in the Timeline panel. Once you’re back to editing the main timeline you’re ready to take the second step.
Specify different Linkage Identifiers for each PageFlip:
- Make sure the Actions panel is visible (Menu»Window»Actions).
- Click on frame #5 of the Pages layer in the Timeline panel.
- Left-click the highlighted Pages movieclip on the stage.
- The Actions panel now shows any code that is placed directly on the Pages movieclip but since there are no actions on the Pages clip the Actions panel should be blank.
- With the Pages clip still selected, paste the following block of code into the Actions panel:
onClipEvent (load) {
this.printID = "print";
} - Now is a good time to test your movie and make sure everything still works. If you get any errors something is amiss and you need to read the tutorial again being sure to follow ALL of the directions. 😉
- Now duplicate the Pages clip by click-drag-releasing it while the Control (Command) key is pressed; or you can use (Menu»Edit»Duplicate).
- Select the newly duplicated “Pages” clip and rename it something like “Pages2”.
- Edit the actions for the new Pages2 clip by selecting it and viewing the Actions panel (Menu»Window»Actions).
- Change this line of code:
this.printID = "print";
To this:
this.printID = "bookB"; - You are done editing all ActionScript code.
Add new content to the library:
It’s time for the third step where you make new pages for the second book. You’ll basically need to follow the Adding Pages tutorial until you get to the 2nd step of the “Creating a Page” section. At that point you need to name the new symbol “bookB” followed by a page number. For example page #9 would be named “bookB9”.
Once you have all of your new pages in the Library with proper linkage identifiers you can test your movie and enjoy the fruits of your labor.
This technique can be used to set other variables which might differ between each book such as page size or page quantity. Simply delete the variable in question from the actions on frame #1 of the Pages clip and then redefine that property for each Pages clip using “onClipEvent”.
Hope it helps.
Dear
How can i add more pages
it is showing only 8 pages max
i have changed the maxpages variable in actions as well and added pages on root frames and also named them print9 print10 print11
but it is showing blank pages after 8
please suggest if u can..
i want on click page flip turn. pleae send me.
no
hey i was just wondering how can i add a magnifying glass to the book tnx
@Will D. White, You’re welcome, glad to have helped.
Hello Mr. PixelWit,
I would like to say thank you so much for the great tutorials you have here! By the way, I am doing my thesis right now and I will cite you as one of my reference. You are really a big help for us students:) thank you very much!
Hey Pixelwit! Thanks for the great tutorials! All the work you’ve put in has helped me develop a nifty portfolio style .fla for a project I’d been working on. Would have been stuck with static pages if it wasn’t for you.
– Will
Dear Sir, I want to know, How to add page in flip book dynamically ( from external source).
with regards
dheeraj