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:

  1. Click on frame #11 of the “Pages” layer.
  2. Double-click the highlighted movieclip in the center of the stage to begin editing the Prints clip.
  3. Click on frame #1 of the Actions layer in the Pages movieclip.
  4. Open the Actions panel if it’s not already visible (Menu»Window»Actions).
  5. Click the magnifying glass icon in the top left corner of the Actions panel to access the “Find and Replace” feature.
  6. 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:
  7. 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:

  1. Make sure the Actions panel is visible (Menu»Window»Actions).
  2. Click on frame #5 of the Pages layer in the Timeline panel.
  3. Left-click the highlighted Pages movieclip on the stage.
  4. 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.
  5. With the Pages clip still selected, paste the following block of code into the Actions panel:
    onClipEvent (load) {
        this.printID = "print";
    }
  6. 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. 😉
  7. Now duplicate the Pages clip by click-drag-releasing it while the Control (Command) key is pressed; or you can use (Menu»Edit»Duplicate).
  8. Select the newly duplicated “Pages” clip and rename it something like “Pages2”.
  9. Edit the actions for the new Pages2 clip by selecting it and viewing the Actions panel (Menu»Window»Actions).
  10. Change this line of code:
        this.printID = "print";

    To this:

        this.printID = "bookB";
  11. 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.

8 Responses to “Multiple PageFlip Books in a File”

  1. Ahmed says:

    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..

  2. raju says:

    i want on click page flip turn. pleae send me.

  3. gabo says:

    hey i was just wondering how can i add a magnifying glass to the book tnx

  4. Pixelwit says:

    @Will D. White, You’re welcome, glad to have helped.

    • Janessa says:

      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!

  5. 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

  6. Dheeraj says:

    Dear Sir, I want to know, How to add page in flip book dynamically ( from external source).
    with regards
    dheeraj

Leave a Reply

PixelWit.com's Comment Guidelines

© Sean O'Shell 2007-2018
css.php